Skip to main content

Changelog & Migration

Version history, breaking changes, and upgrade instructions.

Current SDK versions and how to upgrade between them.

Current Versions

PackageVersionLanguageInstall
risicare0.16.1Python 3.10+pip install risicare
risicare (npm)0.19.1Node.js 18+npm install risicare
risicare-core0.1.9Python 3.10+Installed automatically with the SDK

Install unpinned

Install unpinned: pip install risicare / npm install risicare. Several older Python releases drop spans silently (see below). The notes below cover the current releases, Python 0.16.1 and npm 0.19.1, and each release back to Python 0.4.0 and npm 0.7.0. Only the newest release is supported. To install exactly these releases: pip install "risicare==0.16.1" (it pulls risicare-core>=0.1.8; 0.1.9 is current) and npm install risicare@0.19.1 (Node.js 18 or later). Notes for Python 0.2.0 to 0.3.0 and npm 0.5.0 to 0.6.0 are not written. PyPI has no 0.9.0 or 0.10.0: those versions were not uploaded, and their changes are in Python 0.11.0. npm has no 0.12.0 or 0.13.0: those versions were not uploaded, and their changes are in npm 0.14.0.

Do not use Python SDK 0.1.2 or earlier

Versions 0.1.2 and earlier are missing critical security fixes (auth hardening, SQL injection prevention, OOM protection). Upgrade immediately: pip install --upgrade risicare

Forked workers silently drop every span before 0.1.13

If you run under a pre-fork server — gunicorn --preload, uWSGI, or Celery prefork — Python SDK releases without the os.register_at_fork hook lose 100% of spans emitted in child workers. There is no error and no warning: the child exits 0 and the dashboard simply stays empty, which reads as "no traffic" rather than "broken telemetry".

The hook landed in 0.1.13 and first reached PyPI in 0.1.14, so every published release up to and including 0.1.12 is affected. Upgrade to the current version; do not pin below it.

Current versions: Python 0.16.1 and npm 0.19.1

The current releases are Python risicare 0.16.1 and npm risicare 0.19.1. Only the newest release is supported. Not every page of these docs is checked against them yet. Where a page says what an older release does, it names the release. Python risicare 0.1.0 to 0.4.0 ask for risicare-core with no upper version, so a new install of one of them now installs risicare-core 0.1.9, which has the proprietary licence (see the licence line of the entry for 0.5.0, and the entry for 0.13.0). To upgrade: pip install --upgrade risicare or npm install risicare@latest. Then read the changes that can break a caller in each section below, from your version up. A pin such as risicare~=0.8.0 or "risicare": "^0.18.0" does not take a new minor release. To take the current releases, change it to risicare>=0.16.1 or "risicare": ">=0.19.1".


Python 0.16.1 and npm 0.19.1 — 2026-11-24

These are patch releases. No public function, argument or default changes. risicare-core stays 0.1.9 (the SDK pins >=0.1.8). The data changes: error codes, cancelled requests, the session.end marker and the spans of an OpenAI Agents run. The entries below are for both SDKs, unless they say Python or npm.

Changes to the data:

  • The error code names the cause. Codes move in filters and alerts that use error.code. For example, error.code:TOOL.EXECUTION.CRASHED now finds tool crashes only. See "Changed" below.
  • Cancelled and closed requests are not failed requests. They leave the failed-trace counts, the trace.error webhook and diagnosis. A filter on risicare.lifecycle.status sees a new value, cancelled.
  • The session.end marker is never a failed span.
  • Python, OpenAI Agents: one more span for each turn (one more event of the quota). A run of 3 turns sends 3 more spans. The LLM and tool spans are one level deeper. A reader that counts spans of kind agent as runs must count only the openai_agents.run/ spans (or the traces).

Changed:

  • The error code names the cause. Through Python 0.16.0 and npm 0.19.0, every error that no rule matched got TOOL.EXECUTION.CRASHED, also an LLM HTTP 500, a cut model stream, a validation error in your code and a guardrail tripwire. So you could not tell a tool crash from a provider error. Now the rules come in this order:

    1. A provider's 400 that names a context-length overflow: MEMORY.CONTEXT_WINDOW.EXCEEDED. A content filter: OUTPUT.SAFETY.POLICY_VIOLATION. This rule applies only to a provider error (status 400, or a provider error type). A plain error with the same words does not match.
    2. The HTTP status of the error, from the error object, else from its text: 429 is TOOL.EXECUTION.RATE_LIMITED; 401 and 403 are TOOL.INVOCATION.PERMISSION_DENIED; 400, 404 and 422 are TOOL.INVOCATION.INVALID_ARGS; 408 and 504 are TOOL.EXECUTION.TIMEOUT; another 5xx is TOOL.EXECUTION.DEPENDENCY_FAILED (a model host and a tool's own HTTP service alike).
    3. A model stream that was cut: OUTPUT.FORMAT.TRUNCATED. Python with openai 3.x: a cut stream arrives as a connection error, so it gets TOOL.EXECUTION.DEPENDENCY_FAILED.
    4. A validation error (for example the ValidationError of Pydantic): OUTPUT.FORMAT.SCHEMA_VIOLATION.
    5. A guardrail tripwire (for example the input and output guardrails of the OpenAI Agents SDK): OUTPUT.SAFETY.POLICY_VIOLATION.
    6. A server error of the model host, by its type (for example LMServerError of DSPy): TOOL.EXECUTION.DEPENDENCY_FAILED.
    7. Keyword rules on the text (timeout, rate limit, connection, permission, JSON and others), as before.
    8. No rule matches: TOOL.EXECUTION.CRASHED on a tool span, ORCHESTRATION.LIFECYCLE.CRASHED on any other span.

    An error span has a code, the same with content capture on and off. A cancel or an abort has no code. Three spans keep the error status and get no code: a JavaScript span of startSpan() that an AbortError ended, a JavaScript span of a provider patch that an AbortError ended, and a Python report_error() of a cancel. The error name and the error message stay on the span. The SDK can send 23 of the 154 codes. See What the SDK assigns today.

  • The session.end marker is never a failed span. Its status is ok on the wire, not error. The outcome is in risicare.lifecycle.status (ok, error or cancelled). Through Python 0.16.0 and npm 0.19.0, a failed turn made the marker an error span too, so with the session outside the run one failed request read as two failed traces. Put session_context() (npm: withSession()) outside the run. See Session outside, run inside.

  • Python: a close and a cancel are not errors. GeneratorExit (the consumer closed a generator early, for example the client of a StreamingResponse stopped reading) and a cancel (CancelledError, as Starlette gives on a disconnect; KeyboardInterrupt; SystemExit) end the span of @agent, @trace, @session (its session.end marker), the phase decorators and with risicare.trace with no error status, no exception record and no error.code. The span gets risicare.cancelled, risicare.cancel_type and risicare.lifecycle.status = "cancelled". An exception raised while your code handles the close or the cancel is an error. A TimeoutError from asyncio.wait_for is an error on the span that waited. Through 0.16.0, a close gave the status error with the message GeneratorExit: and a fallback code (a failed run with no reason), and a cancel gave the status error with the cancel marker. See A close and a cancel are not errors.

  • npm: an abort is not an error. An AbortError that ends agent(), the phase wrappers, session() or withSession() gives that span and the session.end marker no error status, no exception record and no error.code. They get risicare.cancelled, risicare.cancel_type = "AbortError" and risicare.lifecycle.status = "cancelled". Through 0.19.0, the entity span of an abort had the status error. An abort of an OpenAI or Anthropic client call (APIUserAbortError) is not an AbortError: its span still reads as a failed call, with a timeout code. See An abort is not an error.

  • Python, OpenAI Agents: a span for each turn. Each turn of a run has a span openai_agents.agent/<agent name> (kind agent) under the run span. The LLM and tool spans of the turn are its children, so after a handoff the tree shows the new agent. An error that passes through the turn fails the span of the agent that owned it, and then the run span. A tool error that the Agents SDK gives to the model fails only the tool span. A cancel of a turn is not an error. Both spans have the kind agent: tell a turn from a run by the name (openai_agents.agent/ against openai_agents.run/). The order of the turns is their start time. The run span keeps its name. Through 0.16.0, every LLM and tool span was a direct child of the run span, which has the name of the starting agent: a failure after a handoff looked like a failure of the first agent. See A span for each turn.

  • A 429 from the api is retried after its Retry-After. When the api limits the request rate, it answers 429 with error.code RATE_LIMIT_EXCEEDED and a Retry-After header. The SDK now waits for that time (never less, at least 1 s, with a small random part on top) and asks again, within bounds:

    • the evaluation helper (risicare eval, the pytest plugin of Python, risicare prompts): one wait of at most 60 s, at most 5 retries, at most 120 s in all;
    • score() (sent in the background): one wait of at most 10 s, at most 2 retries, at most 20 s in all. npm: at exit, the process waits for a score retry, as it waits for a score in flight.

    When the api asks for a longer wait, or a bound is used up, the request fails at once and the error says why. A 429 with no Retry-After fails as before. get_prompt() (npm: getPrompt()) and the fix reads of the fix runtime do not wait on the path of your code: the cached value or the fallback serves the call, and the SDK does not ask again before the Retry-After time (at most one hour). A prompt that the api limits has the reason rate_limited.

  • The no-key WARNING names the RISICARE_API_KEY environment variable only ("keep the key out of your code"). Through Python 0.16.0 and npm 0.19.0, it also said to pass the key to init(), and the Python WARNING named debug=True.

  • npm: the text of a streamed answer. With traceContent on, a streamed OpenAI chat call or Anthropic call writes the answer text to gen_ai.completion.content, as a whole answer does and as the Python SDK does: the text of choice 0 (delta.content) or of the text_delta events, joined, cut at 10,000 code points. While the stream runs, the SDK keeps at most 20,000 UTF-16 units (it does not grow with the stream). With traceContent off, it keeps nothing. The chunks that your code gets are the same, at the same time. Through 0.19.0, a streamed call had no answer text. The other npm provider patches still capture no prompt text and no completion text.

Fixed:

  • Python: an exception whose text cannot be read reaches your code unchanged. Through 0.16.0, an exception whose __str__ raises (or returns something that is not a str) reached the caller of with risicare.trace(...), @risicare.trace and @risicare.agent as the error of its own __str__ (for example RuntimeError('str broke')), not as the original exception. The span ended with no failure, and report_error(exc) made no span. Now your code catches the original exception object on every path: the decorators (@agent, @trace, @session, the phase decorators, sync and async, generators), with risicare.trace, report_error(), the framework integrations and the provider wrappers, the fix runtime and the evaluation helper. The span is marked failed, with the type name and the text <unprintable Bad: its __str__ raised RuntimeError>. A normal exception keeps its exact text. Also, a failure inside the error interceptor of the fix runtime no longer replaces your exception.
  • npm: the WARNING at process.exit(). Through 0.19.0, when your SIGTERM listener ran before the listener of the SDK and called process.exit() at once, no WARNING came. With the listener of the SDK first, the count left out the spans in an export. Now the SDK sets up the WARNING at init(). Any exit before the drain of the SDK (process.exit(), after a signal or not) names the spans that are queued or in an export, in both orders of registration. The spans themselves are still not sent: end the process after the work has stopped, or await flush() before process.exit().
  • npm: require('risicare/package.json'). The exports map of the package had no ./package.json, so require('risicare/package.json') threw ERR_PACKAGE_PATH_NOT_EXPORTED. Tools that read the version of a package in this way can now read it.
  • With tracing off, the identity helpers are silent. With tracing off (a RISICARE_TRACING value that is not recognised, enabled=False (npm: enabled: false), no init(), after shutdown()), set_user, set_session, set_release, set_experiment and add_tags (npm: setUser, setSession, setRelease, addTags) are silent no-ops. Through Python 0.16.0 and npm 0.19.0, they wrote "called outside a span", a wrong cause.
  • Python, OpenAI Agents: a handoff made with handoff() is recorded in framework.openai_agents.handoffs by its agent name. Through 0.16.0, it was the Python text of the Handoff object (with memory addresses).

Added in npm 0.19.0, not listed then:

  • isRisicareCallbackHandler(x) from risicare/langchain: true for a Risicare LangChain callback handler from any entry point of the package (instanceof fails across the bundles of the package).

Known limits:

  • Inside a LangChain or LangGraph tool, a report_error() (npm: reportError()) step attaches to the span around the graph, not to the span of the tool. Name the tool in the message. When the tool raises, its own tool span is still marked failed.
  • npm: the provider patches other than OpenAI and Anthropic capture no prompt text and no completion text.
  • Python: with auto_patch (the default), a task that you submit to a ThreadPoolExecutor or a ProcessPoolExecutor continues the trace that is open when you submit it: a with risicare.trace(...) around a whole batch makes the batch one run. For one run for each item, submit with no trace open, and open the trace inside the task. A multiprocessing.Pool is not patched: its tasks never continue the trace of the parent.
  • The documented order is session_context() (or @session; npm: withSession() or session()) outside the run. The session.end marker is then a one-span trace of its own. It is never a failed trace.
  • The other limits are in one list: Known limits.

Corrections to Python 0.16.0 and npm 0.19.0

These sentences of the entry for Python 0.16.0 and npm 0.19.0, and of its known limits, were not true as published:

  • "A failed LangGraph, CrewAI or Agents SDK run, or a failed provider span, has one exception record. Before, it had two." It is one record on each failed span (before: two on one span). A run has one record for each span that failed: for example 3 for a LangGraph graph with no name whose node raises, and more for a CrewAI run that retries a task.
  • The known limit "An exception whose __str__ raises can be replaced by an exception of the SDK on some error paths." The real effect was worse: the caller got the error of the __str__ of the exception, and the span was not marked failed. Python 0.16.1 fixes it (above).
  • The known limit "A handler that ends the process at once": "In JavaScript, one WARNING at exit names the number of spans." The WARNING did not come when your listener ran before the listener of the SDK, and its count left out the spans in an export. npm 0.19.1 fixes it (above).

Python 0.16.0 and npm 0.19.0 — 2026-11-23

These are minor releases. Defaults and the shape of the data change. No public function is removed, no argument changes, and no new environment variable is added. risicare-core stays 0.1.9 (the SDK pins >=0.1.8). Python 0.16.0 was uploaded to PyPI on 2026-11-22. npm 0.19.0 was uploaded to npm on 2026-11-23. The entries below are for Python, unless they say npm.

Changes that can break an existing caller:

  • The span queue has a byte bound (both SDKs). BatchSpanProcessor(max_queue_bytes=...) (npm: the option maxQueueBytes) has the default 64 MiB. The range is 1 MiB to 4 GiB. init() does not take this option. While the exporter cannot deliver, the SDK drops the oldest spans past the bound, and past 10,000 spans, and counts them (queue_full, or quota_exceeded during a monthly-quota pause). Before, only the number of spans was bounded.
  • Spans that end during a monthly-quota pause are queued with no content (both SDKs), whatever the content capture setting. Before, they were queued with their content.
  • SIGTERM: the handler of your application runs first. See "Changed" below. Before, the whole drain of the SDK (up to 10 s) ran first, and the span of the request in flight was lost.
  • npm: at SIGTERM and SIGINT, the SDK does not shut down when your application has a listener for the signal. See "Changed" below.
  • The boolean RISICARE_* switches read more words (both SDKs). The data changes only where you wrote an on-word that was not read before: npm RISICARE_TRACE_CONTENT=on, a padded value such as true, and the values 1, yes and on of the switches of FixRuntimeConfig.from_env(). See "Changed" below.
  • DSPy: one call of a program is one trace. The trace counts of DSPy projects go down. Before, one ReAct run made up to 10 traces.
  • CrewAI and OpenAI Agents SDK: a tool_call span for each tool call. A tool that fails makes an error trace (it counts for the trace.error webhook), also when the run ends ok.
  • report_error() inside a span records a child step, and the run no longer reads "ended in error". See "Changed" below.
  • npm: the span counts of instrumentLangGraph() go down for a config that your code reuses. See "Fixed" below.

New:

  • max_queue_bytes (npm: maxQueueBytes) on BatchSpanProcessor. See above.
  • A tool_call span for each tool call of CrewAI and the OpenAI Agents SDK. With content capture on, the span has tool.input and tool.output. DSPy tool spans have the same keys. See CrewAI and OpenAI Agents.
  • An agent name for framework runs that had none. The SDK sets it only when no agent is current. The names are ReAct (DSPy), AgentExecutor (LangChain), LangGraph (a graph with no name), the name of a crew (often crew) and the starting agent on the run span of the Agents SDK. The span kind of ReAct and AgentExecutor changes from INTERNAL to AGENT.
  • service.name on every span when service_name is set (npm: serviceName). Python: also on spans that have an agent, and on the spans of LangChain, DSPy, LlamaIndex and LiteLLM. npm: also on spans made inside agent().

Changed:

  • SIGTERM when your application owns it.
    • Python: the handler of your application runs first. Then the SDK flushes for at most 1 s, and it goes on flushing in the background while your server stops. When SIGTERM was SIG_IGN before init(), the SDK does not stop. It flushes in the background. Before, it stopped.
    • Python, with no handler of your application: the bounded drain, then the default death. This did not change.
    • npm: the SDK does not shut down at SIGTERM or SIGINT. It flushes every 250 ms, drains at beforeExit, and shuts down at shutdownTimeoutS after the signal when the process still runs. With no listener of yours, the SDK drains and raises the signal again, as before.
    • Both SDKs: the flushes that the SDK makes at the signal do not use up the loss report of your next flush().
    • See SIGTERM and SIGINT.
  • One parser for every boolean RISICARE_* switch.
    • The words are true, 1, yes, on and false, 0, no, off. The SDK trims the value and ignores the case. In npm, on, off and no are new for the switches other than RISICARE_TRACING.
    • A value that is not one of these words writes one WARNING. For a switch that sends data or makes requests when it is on, such a value is off. For the other switches, it keeps the default.
    • An empty RISICARE_TRACE_CONTENT (npm: also an empty RISICARE_TRACE_STREAM_HELPERS) is off, as before, now with one WARNING. An empty RISICARE_TRACING is the same as no value.
    • Python switches: RISICARE_TRACING, RISICARE_TRACE_CONTENT, RISICARE_DEBUG, RISICARE_OTEL_BRIDGE, RISICARE_FIX_RUNTIME, RISICARE_STRICT_INSTRUMENTATION and the switches of FixRuntimeConfig.from_env(). npm switches: RISICARE_TRACING, RISICARE_TRACE_CONTENT, RISICARE_TRACE_STREAM_HELPERS, RISICARE_DEBUG, RISICARE_COMPRESS, RISICARE_FIX_RUNTIME and RISICARE_FLUSH_ON_CRASH.
    • Before, FixRuntimeConfig.from_env() read only the word true.
    • The WARNINGs for stream_usage and error_text (npm: streamUsage and errorText) are written one time for each value. They name the variable when the value came from it.
  • report_error() inside a span. It makes a child step named error:<Type>. The run no longer reads "ended in error". Outside a span, it is as before. See report_error.
  • Errors of framework runs.
    • A failed LangGraph, CrewAI or Agents SDK run, or a failed provider span, has one exception record. Before, it had two. (Correction: it is one record on each failed span. A run has one record for each span that failed. See Corrections to 0.16.0.)
    • A break out of a LangGraph or LangChain stream is not an error.
    • A guardrail tripwire of the Agents SDK names the guardrail and its kind in error.message.

Fixed:

  • Decorators on generators. @agent, @trace, @session and the phase decorators on a generator function or an async generator function (for example the generator of a FastAPI StreamingResponse) now make a span that covers the iteration. The LLM calls of the body are its children, with its agent and its session, and its error is recorded. Before, the span was a 0 s span with status ok, and the body ran in traces of its own. See Decorators.
  • Fork safety. A forked child no longer hangs at its first span, flush(), init() or shutdown() when a parent thread held a lock of the SDK or of risicare-core at the fork. A worker that got SIGTERM right after its fork no longer hangs in the drain. See Multi-worker servers and fork().
  • npm: instrumentLangGraph() never changes your config. A subgraph inside a node no longer raises a TypeError. A config that you reuse no longer multiplies the spans. See LangGraph.

Known limits: the limits of these releases are in one list: Known limits of Python 0.16.0 and npm 0.19.0.


Python 0.15.0 and npm 0.18.0 — 2026-11-21

These are minor releases. get_metrics()["dropped_spans_by_reason"] (npm: getMetrics().droppedSpansByReason) has two new keys, after_shutdown and open_at_shutdown. A span that was open at shutdown() and ended after it was counted as shutdown_residue; it is now open_at_shutdown. npm: getTracer() no longer returns undefined after shutdown(). No other return value and no default of the API changes. risicare-core stays 0.1.9 (the SDK pins >=0.1.8).

Changes that can break an existing caller:

  • A span that was open at shutdown() and ended after it is open_at_shutdown, not shutdown_residue. Code that reads shutdown_residue for this case must read the new key. shutdown_residue keeps the spans that shutdown() could not send in its time.
  • A span after shutdown() makes the next flush() return False (npm: false). Before, such a span was in no counter, and flush() returned True. See "Fixed" below.
  • npm: getTracer() returns a tracer after shutdown(). Before, it returned undefined, so getTracer().startSpan(...) threw a TypeError. The retired tracer makes no span and counts the span. After a new init(), a tracer that your code kept from before sends its spans to the new tracer.
  • Python: the line that init() writes has new words. It said "Tracing active". It now says "Tracing configured" and adds that delivery is not checked yet. Code that matches the old text must change. See "Changed" below.

New:

  • risicare doctor (Python only). It checks, one line for each check, that spans from this host can reach Risicare. The checks are the SDK version, the API key (only its prefix and length are shown), the endpoint, the proxy rule, reachability, the clock, whether the gateway takes the key (an empty POST /v1/spans), one test span named risicare.doctor, and the installed instrumentations. The exit code is 0 only when the gateway accepted the test span; 3 with --no-send; 1 when a check failed; 2 for a usage error. The output is safe to paste in a support thread: of the key it shows only the prefix and the length, and it shows no user name or password of a URL or of a proxy value. See Check Your Setup. The JavaScript SDK does not have this command.
  • The drop reasons after_shutdown and open_at_shutdown.
    • after_shutdown: a span that would start after shutdown(), before a new init(). The SDK counts it for the tracer API, the decorators, the session marker, the provider patches, report_error() (npm: reportError()) and the framework integrations. Python also counts it for the OpenTelemetry bridge. npm also counts it for tracedStream(), instrumentLangGraph(), patchInstructor(), RisicareCallbackHandler and RisicareLlamaIndexHandler. npm counts it also after the SDK's own drain at SIGTERM, SIGINT or beforeExit.
    • open_at_shutdown: a span that was open at shutdown() and ends after it.
    • The next flush() returns False (npm: false), and at most one WARNING of each reason for each shutdown says what to do: call flush() at the end of each invocation, and shutdown() only where the process ends.
    • A count can be higher than the spans lost, never lower. Python examples: a LangChain, LlamaIndex or DSPy root run with N patched LLM calls counts 1 + N; a LlamaIndex streaming query counts 3; an OpenTelemetry trace with a child and a root after shutdown() counts 2. npm example: a LangChain or LlamaIndex root run with N patched LLM calls counts 1 + N, unless the run is inside the handler's withSuppression(). The count is made before sampling.
    • Your call is not changed: a fault of the count never reaches your function, your framework call or your LLM call. npm: after shutdown(), a patched provider call takes the path of a call after disable(): no span, and nothing is sent.
    • init() after shutdown() is supported. See Serverless functions.

Changed:

  • The first output says what it knows. Python: the init() line was [risicare] Tracing active — ..., also with a key that the endpoint refuses. It is now [risicare] Tracing configured — endpoint: …, service: …. Delivery is not checked yet: a WARNING follows if the endpoint refuses the key or cannot be reached. npm: the SDK still writes no startup line.
  • The outage WARNING gives the next step (both SDKs). The WARNING ("spans are NOT reaching ...", at most one in 5 minutes) gives the next step for each answer: 404, 429, 400, 408, 502 or 504, 503, another 5xx, another 4xx, and no answer. A 401 or 403 keeps its text. For an answer with no status, the WARNING no longer names an invalid API key as a cause. See What the outage WARNING says for each answer.
  • At shutdown(), the WARNING for the spans that could not be sent names the outage, when there is one, instead of advising a longer timeout. The outage WARNING that shutdown() writes when it ends the retries gives the next step too.
  • Python: the sdist is smaller. It ships the package source, not the tests or the generator scripts. It is 0.6 MB instead of 1.4 MB. The wheel is unchanged.

Fixed:

  • Python: the OpenTelemetry bridge raised from span.end(). With risicare through 0.14.0 and opentelemetry-sdk 1.40.0 or later, span.end() raised AttributeError when the bridge was on (otel_bridge=True, or RisicareSpanProcessor added by hand). The OTel SDK calls a new _on_ending hook on each span processor from Span.end(), and RisicareSpanProcessor did not have it. So every span.end() of the application raised, also while the SDK was active. The processor and the exporter now subclass the SpanProcessor and SpanExporter of the OTel SDK, define every hook, and never raise into the code of your application. They are tested with a real TracerProvider on opentelemetry-sdk 1.20.0 and on 1.45.2. To fix this, upgrade risicare. See OpenTelemetry.
  • A span after shutdown() is counted. A span after shutdown() was lost without a signal. A warm serverless handler that called shutdown() at the end of each invocation lost each invocation after the first, while flush() returned True (npm: true) and no counter moved. Now the SDK counts such a span, the next flush() returns False (npm: false), and one WARNING says what to do.

Python 0.14.0 and npm 0.17.0 — 2026-11-20

These are minor releases. They send more by default. No return value and no default of the API changes. risicare-core stays 0.1.9 (the SDK pins >=0.1.8). The new npm option flushOnCrash is off by default.

Changes that can break an existing caller:

  • The tool calls of an answer are on the span.
    • Python: a streamed OpenAI or Anthropic call now sends the arguments of its tool calls, as a call that is not a stream always did. The same holds for the names, the counts and the finish or stop reason of the tool calls of a streamed answer.
    • npm: the names and the arguments of the tool calls of an OpenAI chat, Responses or Anthropic call are now on the span, also for a stream. Before, an OpenAI span had only gen_ai.response.tool_call_count, a chat stream had nothing, and an Anthropic span had no tool call.
    • To turn the arguments off, turn off content capture: trace_content=False (npm: traceContent: false) or RISICARE_TRACE_CONTENT=false. This turns off all content: the prompts, the completions and the tool arguments.
    • The names, the counts and the finish or stop reason are not content. The SDK sends them with content capture on or off, and no option turns them off.
  • The is_error flag of an Anthropic tool result is kept. In gen_ai.input.messages, the tool_call_response part of an Anthropic tool_result keeps the is_error flag of the block (only a real boolean). So you can tell a failed tool from a tool that answered. Before, the SDK dropped the flag. The key is content: the content switch turns it off.
  • npm: the stream helpers of openai make a span. responses.stream(), chat.completions.stream() and beta.chat.completions.stream() (openai 4.x) now make a span, with content when content capture is on. Before, they made none. To turn this off, set traceStreamHelpers: false or RISICARE_TRACE_STREAM_HELPERS=false. The helpers then run exactly as without Risicare, with no span. create({ stream: true }) stays traced.
    • A helper of another shape (openai 4.15 to 4.18, or a future version) runs as before, with no span.
    • A break out of a helper loop, or its abort(), marks the span as cancelled, with no error status.
    • A frozen client (Object.freeze) is not traced, and reading its resources no longer throws.

New:

  • Tool-call keys on the span of an OpenAI or Anthropic call. The keys are the same in both SDKs.
    • OpenAI (chat completions; npm also Responses): gen_ai.completion.tool_calls (the number of calls), gen_ai.completion.tool_call.{j}.name, gen_ai.completion.0.tool_calls.{j}.arguments and gen_ai.completion.finish_reason.
    • Anthropic: gen_ai.completion.tool_uses, gen_ai.completion.tool_use.{j}.name, the same arguments key (the input, as JSON text) and gen_ai.response.stop_reason.
    • The names and the arguments of the first 5 calls are written. The arguments go out only with content capture on, after the mask. Each argument text is cut at 10,000 characters (npm: code points). At most 1,000 calls of one stream are counted.
    • OpenAI: the first choice only. A stream that ends early (you stop reading it, an error, a cancel) records what it received, with no reason. The id of a call is not on the span of the call that made it. With content capture on, it is on the span of the next call, in gen_ai.input.messages.
    • Python: this covers create(stream=True) of both providers (sync and async), the OpenAI chat.completions.stream() helper and the Anthropic messages.stream() helper. Before, a streamed answer recorded no tool call and no finish or stop reason. The exception was messages.stream() on anthropic 0.30 and 0.40, which read the final message.
    • npm: this covers OpenAI chat (non-stream and stream), Responses (also the final event of a stream) and Anthropic (non-stream and stream). A stream that you take another way (tee(), toReadableStream()) records no tool call. The Anthropic input is written as JSON.stringify writes it. The Python SDK writes the same value with json.dumps, so the two texts can differ in spacing and in the escapes of non-ASCII characters: parse them.
  • npm: flushOnCrash. With init({ flushOnCrash: true }) or RISICARE_FLUSH_ON_CRASH=true, the SDK sends the queued spans when Node is about to end the process for an uncaught exception or an unhandled rejection. It is for Node only, and it is off by default.
    • The main thread waits at most 2,000 ms while a worker thread sends. Then Node writes its own report and exits with its own code.
    • The SDK never takes the crash from your code or from a library such as Sentry or PM2. When something else handles the error, that code decides. The SDK then only starts a flush of at most 2,000 ms, with no wait: at most one at a time, and one start in 1 s. A crash during shutdown() is covered too.
    • The crash send uses the content rules (traceContent, errorText, mask) and the batch bounds of an export. It sends the newest spans first, up to 16 MiB of bodies plus at most one batch. It costs about 13 MiB plus about 2.6 times the bytes of the bodies, and it stops near the heap limit or the memory limit of the container.
    • The crash send does no DNS lookup, follows no redirect and uses no proxy. It sends to an IP address in the endpoint, or to an address that the SDK found for the host name after a successful export (at most 10 minutes old). With https, any such address is used. With plain http, only a loopback address is used. Else nothing is sent.
    • A second init() with another flushOnCrash or traceStreamHelpers value writes a warning, as for the other options that a second init() cannot change.

Known limits:

  • npm: flushOnCrash finds the crash address with c-ares, not with the system resolver. So the crash send can differ from the normal export where /etc/hosts or a Kubernetes hostAliases entry gives the address (issue 228). With a policy that allows only the private path, keep the option off.
  • The Python and the JavaScript commands of risicare eval gate still differ on a few unusual inputs of the old flags (issue 224).

Python 0.13.1 and npm 0.16.1 — 2026-11-19

These are patch releases. They add one option to risicare eval gate and change some words in its output. Every command line that worked before keeps its request, its exit code and its --json output. risicare-core stays 0.1.9 (the SDK pins >=0.1.8).

New:

  • risicare eval gate --fail-under T: the plain mode for a small dataset. The gate fails (exit 100) when the observed pass rate of the run is under T, and passes (exit 0) on T or over it. A trial with no result counts as not passed. The result is an observed result, not a proof: --json gives gate.basis observed. Read the rate from the fail_under criterion (criteria[].value), not from run.pass_rate. The option cannot be used with --min-pass-rate, --min-pass-all, --baseline, --max-drop, --strict or --allow-no-verdict (exit 2, and no call). It needs the api of 2026-11-18 or later. See The Gate.

Changed:

  • The words of risicare eval gate change: a met or missed row ends with "(proven)" or "(not proven: ... hides it)"; an unclear row says how many cases do not prove it; a hint gives the case counts from which an all-pass run is proven met (16 / 35 / 73 at 0.8 / 0.9 / 0.95); a 404 baseline_not_found prints new words. The exit code, the request and --json do not change. For a script, read the exit code and --json: the words of the table and of stderr can change in a patch release.
  • The api of 2026-11-18 changes some gate results for every version of the SDK, because the command passes the api's exit code through. The interval of the pass rate is now the 95 percent Wilson interval of the case mean. So a small run that was missed can now be unclear, and it then passes by default (exit 0). A run in which every case passes is met only from 16 / 35 / 73 cases at 0.8 / 0.9 / 0.95. A proven miss always fails: it exits 100 also with --allow-no-verdict, and also when the comparison has no verdict. See The Gate.
  • With no criterion, the api also passes a run that is not closed. The old WARNING, --help and README said that it gives 101 for such a run. That was wrong. The behaviour did not change; the words are now correct.

Known limits:

  • The Python and the JavaScript commands still differ on a few unusual inputs of the old flags (issue 224).

Python 0.13.0 and npm 0.16.0 — 2026-11-18

These are minor releases. Read the first list before you upgrade. With content capture off, the error text no longer leaves your process, a cancel gets no error.code, and (Python) some framework calls give fewer spans, so a dashboard that counts spans can show lower numbers. risicare-core 0.1.9 was published first. It changes only text (the LICENSE, the README and the package description), and the SDK keeps the floor risicare-core>=0.1.8.

Changes that can break an existing caller:

  • With content capture off, the error text is withheld. With trace_content=False (npm: traceContent: false), the SDK replaces these values with <risicare:content-omitted> before they leave your process: the status message, the exception messages and their copies in the stack traces, error.message, exception.message and error.stack. An error message can hold your prompt or the output of the model: the 400 answer of a provider can repeat the input, a validation error names the value, a parser error quotes the answer. Before, only the project switch at the gateway withheld them.
    • The exception type, error.code, the status and the frame lines of a stack stay. The SDK classifies error.code from the full text before it withholds the text, with content capture on and off.
    • A line of a stack trace is kept only when it has the exact shape of a frame line: Python File "...", line N, in name with its one source line and its caret lines, or JavaScript at name (file:line:column) or at file:line:column. Any other line gets the marker.
    • New option error_text (npm: errorText; or RISICARE_ERROR_TEXT). The values are "auto" (the default; npm: 'auto'), True and False. "auto" follows the content switch. True sends the error text also with content capture off (the behaviour of Python 0.12.0 and npm 0.15.0): use it only when you need the messages and accept that an error message can carry prompt or model output. False withholds it also with content capture on. A second init() with another value warns.
  • A cancel is never classified. Python: report_error() of asyncio.CancelledError, KeyboardInterrupt or SystemExit gets no error.code. Before, it got TOOL.EXECUTION.CRASHED. npm: an AbortError span gets no error.code. Before, it got TOOL.EXECUTION.TIMEOUT. The session.end marker of a cancelled session keeps its error status, and now has the cancel marker (risicare.cancelled, risicare.cancel_type).
  • Python: some framework calls give one span where they gave two. Pydantic AI: one run_sync call gives one agent span (it gave two nested spans with the same name). LlamaIndex: one model request gives one LLM span, and its tokens are counted one time (the helpers around a call gave extra LLM spans, so the cost was counted two times). CrewAI: kickoff_async gives one crew span. See "Fixed" below.
  • Python: a strict program can stop at boot. With RISICARE_STRICT_INSTRUMENTATION=1, a library that is only partly traced raises InstrumentationError. A strict program on anthropic 0.30 or 0.40 that started on Python 0.12.0 stops at boot on 0.13.0: the messages.stream() helper is now traced, and on these versions the trace is partial (partially_instrumented).
  • The public text and the LICENSE. The README says that Risicare is a free beta and that the service does not offer error diagnosis and fixes yet. The LICENSE no longer requires a paid subscription: the grant is subject to the terms of service agreed between your organization and Conscience Labs Pvt. Ltd.

New:

  • The OpenAI Responses API is traced. responses.create (plain and streamed) and responses.parse have their LLM span, with the chat span shape (the messages of instructions and input, the answer, the tool calls, the status, the token counts, and the cache and reasoning counts). Before, a call of the Responses API had no span. The OpenAI Agents SDK (its default model), Pydantic AI's OpenAIResponsesModel and LangChain's use_responses_api call it. An error event of a stream, or a failed response, marks the span as an error. npm: the responses.stream() helper is not traced in 0.16.0; it is traced from 0.17.0.
  • Python: google-genai is traced. Each model request has one LLM span with its tokens, also in the automatic function calling loop. This covers sync and async calls and streams, chats, the Gemini API and Vertex AI.
  • Python: OpenAI structured outputs. client.chat.completions.parse(...) has its LLM span (sync and async, also through with_raw_response and with_streaming_response).
  • Python: Anthropic stream helpers, messages.parse and beta.messages. The messages.stream() helper (sync and async), messages.parse, and beta.messages.create / stream() / parse have their LLM span, with the tokens and the cache counts. Before, none of them had a span.
  • Token counts for more calls. Python: a with_raw_response call (OpenAI, Anthropic, Groq, Cerebras, Together) has the tokens and the model of its answer, and so has a with_streaming_response call that is not a stream. CrewAI calls OpenAI this way, so CrewAI calls now have tokens and cost. npm: asResponse() of a call that is not a stream (OpenAI, Anthropic, Groq, Together, Cerebras) has the token counts. The SDK reads a clone of the body, up to 1 MiB.
  • stream_usage (npm: streamUsage): the token counts of a streamed OpenAI call. The OpenAI API sends them only when the request asks for them. When your call does not set stream_options, the SDK asks for them. Python: "auto" (the default) asks only on https://api.openai.com, True on any host, False never, or RISICARE_STREAM_USAGE. npm: the default 'auto' does not ask; true (or RISICARE_STREAM_USAGE=true) asks on any host. Your code gets the same chunks as without Risicare, with one exception: code that reads the raw stream sees the extra usage chunk. Python: code that reads the transport of an already parsed stream (stream.response.iter_lines(), iter_bytes(), iter_text()), stream._iterator or copy.copy(stream); set stream_usage=False for such code. npm: asResponse(), toReadableStream() and tee(). A host that refuses the field fails that one call, with one WARNING, and the SDK does not ask that host again.
  • Cache and reasoning token counts for more providers (gen_ai.usage.cache_read.input_tokens, gen_ai.usage.cache_write.input_tokens, gen_ai.usage.reasoning.output_tokens): Gemini (the cached and the thinking tokens), Bedrock Converse (the cache read and write tokens) and Groq. npm: Gemini through patchGoogleAI, and Bedrock InvokeModel with an Anthropic body. A count is sent only when the provider gives it.
  • Python: the agent on the spans of each agent turn. In a multi-agent run, the spans of each turn carry that agent: OpenAI Agents, Pydantic AI, CrewAI (the role), AutoGen agentchat, LangGraph (named graphs) and LlamaIndex workflow agents. The SDK sets no agent when the framework gives no name.
  • risicare eval gate warns when no criterion is given. With none of --baseline, --min-pass-rate, --min-pass-all and --require-holdout, the command prints a WARNING on stderr. The exit code does not change. Python: at the end of the session, the pytest plugin prints a WARNING for each test that passed while its case did not pass all its trials and that did not read the result.

Fixed:

  • Python: one span where there were two (Pydantic AI run_sync, LlamaIndex, CrewAI kickoff_async; OpenAI Agents Runner.run_streamed has a run span over all turns).
  • Streams. Python: a streamed LlamaIndex LLM call has its tokens and its response model, and its span ends when the stream ends. Python: a Groq stream has its token counts (the groq client puts them in x_groq.usage). Python: an async stream that the provider library drops without a close no longer gets a false cancel marker at the end of asyncio.run().
  • The 403 for a missing scope names the key class that holds it: a CI key for prompts:write; a Secret key (or a CI key in a pipeline that sends no spans) for the evaluation and dataset scopes; the role of the maker for scores:write and prompts:read.
  • npm: risicare eval --help and -h print the usage of eval gate on stdout and exit 0. Before, they printed "unknown command" and exited 2.

Known limits:

  • Error text: a line that has the exact shape of a frame line is kept, also when your code wrote it.
  • A 1-hour cache write (Anthropic, Bedrock) is counted in gen_ai.usage.cache_write.input_tokens, so the token total is correct, but its cost is under-counted (priced as a 5-minute write) until the server knows a key for it (issue 211).
  • Bedrock ConverseStream has no token counts.
  • Gemini thinking tokens are in gen_ai.usage.reasoning.output_tokens, not in the completion count. The server does not price that key yet, so the cost of a Gemini thinking model is under-counted.
  • Python: google-genai wraps private methods. When a release does not have one, Risicare traces the public method in its place (get_instrumented_modules()["google.genai"]["state"] is partially_instrumented, with a WARNING). google-genai 2.30.0 and later resume a stream that breaks after a continuation token: your code gets the whole answer and no exception, but the request that broke has an error span.
  • npm: when a Node process ends by an uncaught exception or an unhandled rejection, the queued spans are not sent. From 0.17.0, the option flushOnCrash sends them.

Python 0.12.0 and npm 0.15.0 — 2026-11-13

These are minor releases. They add a command, risicare prompts pull | push | status, and an environment variable, RISICARE_PROMPT_LABEL. They change nothing for a caller of an existing function. A program that does not run the new command and does not set the variable sends the same requests as before, and the same span attributes except where "Fixed" below says. Python: risicare-core stays 0.1.8.

New:

  • risicare prompts: prompts that live in git. The command keeps prompt files and the prompts in Risicare in step.
    • risicare prompts pull [NAME ...] [--label LABEL | --version N] writes the prompts that a label holds (default production) to prompts/<name>.json. A file that has changes which are not in the store is kept (exit 1) unless --force.
    • risicare prompts push [NAME ...] (--note TEXT | --note-from-git) saves each file as a version. The api compares the hash of the content with the stored versions, so a repeat changes nothing. A key never moves the label production, so the command refuses --label production before it sends anything. The key must be of class ci with prompts:read, prompts:write and prompts:export. A key of class secret can pull and run status, but it cannot push.
    • risicare prompts status [NAME ...] [--label LABEL] compares the files with the version that a label holds, writes nothing, and prints one state for each file.
    • --dry-run writes nothing. --diff and --dry-run print a unified diff. --json prints one JSON object. The exit codes: 0 done, 1 the command could not finish, 2 a usage error, 100 (status only) a file differs from the store.
    • The command reads RISICARE_API_KEY and RISICARE_API_URL, calls the api host and no other host, and never prints or writes the key. A Python file and a JavaScript file for the same prompt have the same bytes.
  • RISICARE_PROMPT_LABEL. With neither label nor version, get_prompt (npm: getPrompt) pulls the label in RISICARE_PROMPT_LABEL (for example staging) and, when that is not set or empty, production. A label or a version in the call always wins.

Changed:

  • The WARNING for a 401 or 403 says who refused. Before, each 401 and 403 of POST /v1/spans gave the same text. The SDK now reads the error.code of the JSON answer: path_not_public (403) is the edge of a host that does not forward spans, for example the API host, and the WARNING says to set the endpoint to the ingest gateway; AUTHORIZATION_FAILED (403) is the api, for a key that does not hold the scope. A failed score() names the same causes. The requests and the span attributes do not change.

Fixed:

  • Python: DSPy 3.5. The LLM span of a DSPy module call had no tokens, no cost and no response model, and its content was the Python text of the request and the response, not JSON. It now takes the tokens, the cost and the response model from the lm.history entry of its own call.
  • Python: the prompt keys reach the LLM spans of the framework integrations. Inside prompt_context() or prompt.context(), the LLM span of a LangChain, LangGraph, DSPy, LlamaIndex or LiteLLM call now has the keys of the block. The embeddings spans of LlamaIndex and LiteLLM now carry gen_ai.operation = "embeddings" and get no key. Spans that the OpenTelemetry bridge converts still get no key.
  • npm: a LlamaIndex embedding span gets no prompt key. Inside withPrompt() or prompt.run(), the span of a LlamaIndex embedding event got the prompt keys. It now carries gen_ai.operation: 'embeddings' and gets none.
  • npm: risicare --help and -h name both commands (eval gate, and prompts pull | push | status) and exit 0. Before, they printed "unknown command" and the usage of eval gate only, and exited 2.

Python 0.11.0 and npm 0.14.0 — 2026-11-06

PyPI has no 0.9.0 or 0.10.0; their changes are in 0.11.0.

npm has no 0.12.0 or 0.13.0; their changes are in 0.14.0.

risicare-core stays 0.1.8. These releases add a way to pull a prompt, an evals helper with a gate command, new score() fields and prompt keys on LLM spans. They also change what the OpenAI and Anthropic patches send by default. Read the first list before you upgrade from Python 0.8.0 or npm 0.11.0.

Changes that can break an existing caller:

  • The OpenAI and Anthropic patches send the whole request. With content capture on (the default), a call through the OpenAI patch or the Anthropic patch (patchOpenAI, patchAnthropic in npm) sends three more attributes. Before, it sent the first 10 messages as text (gen_ai.prompt.{i}.*) and, for Anthropic, the first 5,000 characters of a string system. A default install now sends your tool definitions and your whole message list.
    • gen_ai.tool.definitions: your tools in one flat form (name, description, parameters). Cap: 24,576 bytes.
    • gen_ai.system_instructions: the Anthropic system prompt, a string or a list of blocks, kept whole. The old rule cut a string at 5,000 characters and dropped a list. Cap: 16,384 bytes.
    • gen_ai.input.messages: the whole messages list in the OpenTelemetry parts form, with each tool call and tool result paired by id. Cap: 49,152 bytes.
    • A value above its cap is cut and stays valid JSON. The SDK cuts the longest strings first, and each cut string ends in ... [truncated]. Then a long list keeps its first and last items. The SDK writes the three keys last. It writes a key only if the strings on the span stay at or below 96,000 bytes. A key that does not fit is not written at all.
    • To raise the cap of the message list, set max_input_messages_bytes in init() (npm: maxInputMessagesBytes). The default is 49,152 bytes. The range is 1,024 to 65,535. Raise it if your prompts are long. The 96,000-byte limit of the span stays.
    • To stop it, set trace_content=False (npm: traceContent: false) or RISICARE_TRACE_CONTENT=false. The SDK then does not build or send the three keys.
    • These parameters are not content. The SDK sends them with capture on or off: gen_ai.request.top_p, gen_ai.request.tool_choice, gen_ai.request.stop_sequences (the stop of OpenAI) and gen_ai.request.seed (OpenAI only). It does not send a parameter that you did not set. The old keys, the other providers, the frameworks and the OpenAI Responses API do not change.
  • The OpenAI patch reads max_completion_tokens. The span of an OpenAI call records gen_ai.request.max_tokens from max_completion_tokens when it is set, and from max_tokens when it is not. Before, a call that set only max_completion_tokens had no value for this key. A call that sets only max_tokens is not affected.
  • npm: ScoreOptions is now a union type. It is a union of ScoreValueOptions (has value) and ScoreFailedOptions (judgeFailed: true, no value). The package exports both. A call with an object literal compiles as before. A TypeScript interface that extends ScoreOptions does not compile now. Extend ScoreValueOptions or use a type alias.

New:

  • Pull a prompt: get_prompt (Python) and getPrompt (npm).
    • Python: risicare.get_prompt(name, label=, version=, fallback=, cache_ttl_s=, timeout_s=). npm: getPrompt(name, { label, version, fallback, cacheTtlMs, timeoutMs }). The call sends GET /v1/prompts/resolve to the api host with the key of init().
    • The key needs the scope prompts:read. An ingest key and a secret key have it.
    • Give label or version, not both. With neither, the label is production. The SDK pulls nothing at import time or at init(). In npm, a bad argument rejects with a TypeError.
    • The call returns a Prompt. It has name, version, hash, label and source. source is server (this call pulled it), cache, stale or fallback.
    • The content is messages, model, parameters, tools, output_schema (npm: outputSchema) and variables. repr(prompt) in Python, and String(prompt) and JSON.stringify(prompt) in npm, show the identity and not the text.
    • The cache is in memory, one for each process, with at most 500 entries and no disk. A version pin never expires.
    • A label is fresh for cache_ttl_s (default 60 seconds, from 5 to 3,600) or, in npm, cacheTtlMs (default 60,000, from 5,000 to 3,600,000). After that, the next call gets the cached value at once, and one background refresh asks with If-None-Match. The api answers 304 when the label did not move, and the SDK keeps the value.
    • Only the first call for a key waits for the network. It waits no longer than timeout_s (default 1 second, from 0.1 to 10) or, in npm, timeoutMs (default 1,000, from 100 to 10,000).
    • A refresh that fails (a network error, a 5xx, a timeout, 401, 403, 404 or 410) keeps the last good value. The SDK sets source to stale and writes one WARNING for each key each minute.
    • When the first pull fails and nothing is cached, the call returns the fallback. If you gave none, Python raises risicare.PromptUnavailable and npm rejects with PromptUnavailable. The error has the reason and the HTTP status. The SDK does not ask for a failed key again inside one cache TTL, so a down api does not add a timeout to every call.
    • The fallback is risicare.PromptContent(messages, model=, parameters=, tools=, output_schema=, version=) in Python and new PromptContent({ messages, model, parameters, tools, outputSchema, version }) in npm. The SDK computes its hash with the RFC 8785 canonical form and SHA-256, the same as the api. A fallback with the same content as a stored version, key for key, has the hash of that version. A pulled prompt keeps the content_hash that the api sent.
    • RISICARE_PROMPT_CACHE_TTL_S (5 to 3,600) and RISICARE_PROMPT_TIMEOUT_S (0.1 to 10) set the defaults, in seconds in both SDKs. The SDK ignores a value out of range and writes one WARNING.
    • In Python, the refresh is a thread of the SDK. It starts on first use, and again after a fork. In npm, the refresh is a promise with an AbortController.
    • New names in Python: get_prompt, Prompt, PromptContent, PromptUnavailable and MissingVariable. New exports in npm: getPrompt, Prompt, PromptContent, PromptUnavailable, MissingVariable, and the types GetPromptOptions, PromptContentOptions, PromptSource and PromptMessage.
  • Body helpers: compile, openai_body and anthropic_body (npm: compile, openaiBody and anthropicBody).
    • prompt.compile(**values) (npm: prompt.compile(values)) gives the messages with the values put in. A placeholder is {{name}} or {{ name }}. Any other {{ is plain text. A value that is not a string goes in as compact JSON. A missing value raises risicare.MissingVariable (npm: throws MissingVariable). The SDK never reads a value again as a template.
    • prompt.openai_body(**values) (npm: prompt.openaiBody(values)) gives a dict or object for client.chat.completions.create. It writes max_output_tokens of the prompt as max_completion_tokens, the current field of the OpenAI chat completions API. max_tokens is the legacy name, and newer models refuse it. A server that takes only max_tokens (some OpenAI-compatible hosts) gets it from you: rename the key.
    • prompt.anthropic_body(**values) (npm: prompt.anthropicBody(values)) gives a dict or object for client.messages.create. It writes max_tokens from max_output_tokens and adds no default. The Anthropic API needs max_tokens, so set it when the prompt does not.
    • The Anthropic helper never puts temperature or top_p in the body, because the current Anthropic API version refuses them on every model. It also leaves out seed and the output schema. It writes one WARNING that says so.
    • Both helpers leave out the keys that the prompt does not set. Neither adds a default. In npm, the helpers are typed any, so the result fits the type of the provider client.
  • Four prompt keys on LLM spans.
    • When the messages of an OpenAI or Anthropic call come from compile(), openai_body() or anthropic_body() (npm: openaiBody() or anthropicBody()), the span has risicare.prompt.name, risicare.prompt.version (text), risicare.prompt.hash and risicare.prompt.label. The SDK writes them with content capture on or off. A fallback has a hash and no label. In npm, the patchOpenAI and patchAnthropic clients write them. The three bundles (risicare, risicare/openai, risicare/anthropic) and the CJS build read the same reference.
    • The returned list carries a hidden reference to the prompt. In Python it is a list subclass. In npm it is a plain array with a property that has a symbol key and is not enumerable. It compares equal to a plain list, and its JSON does not change.
    • A copy does not keep the reference: list(messages), a slice or a new list in Python; a spread, slice, map or structuredClone in npm. For such a path, use with prompt.context(): or prompt.run(fn, *args) in Python, and prompt.run(fn) in npm.
    • The list replaces an enclosing prompt_context block (npm: withPrompt) as a whole. All prompt keys of the span come from the list, and none from the block. A version pin has no label, so it gets no label from the block. A plain list still gets the block, as before.
    • prompt_context(name, version, hash=None, label=None) takes two more optional arguments. npm: withPrompt(name, version, fn, { hash, label }). They follow the rules of name and version, and they write risicare.prompt.hash and risicare.prompt.label.
    • No template text and no variable value goes on a span.
  • Prompt version on the LLM span: prompt_context(name, version) (Python) and withPrompt(name, version, fn) (npm).
    • Each LLM span that starts inside the block gets risicare.prompt.name, risicare.prompt.version and llm.prompt_template.version (the same text as the version; OpenInference has no key for the name). The dashboard shows them as a chip and can filter by them.
    • The scope is one call, not the trace. A nested block replaces the outer block. An agent, tool, function or embeddings span gets no key. A key that you set with attributes is not overwritten. A stream that you read after the block ends keeps the keys.
    • A value is a non-empty string or an integer, at most 200 characters. A boolean, a float or an empty value does nothing and writes one WARNING. The SDK does not send the prompt text. The keys are metadata, so the SDK sends them with content capture off too.
  • Evals: from risicare import evals (Python) and import { runDataset, defineCheck } from 'risicare/evals' (npm, a new entry point).
    • Python: evals.run(dataset=..., function=..., checks=[...], trials=k). npm: runDataset({ dataset, fn, checks, trials }). Each runs the cases of a dataset version through your function. Each case and trial runs under its own trace.
    • A trace carries risicare.experiment.id (the run id) on every span. When you give release, it also carries risicare.release. The root span risicare.eval.trial also has risicare.experiment.case_id and risicare.experiment.trial. The helper writes no other attribute.
    • The helper posts one score for each check and trial (with three retries), posts the results in batches of 50, closes the run and writes risicare-run.json (no key). It runs no model and no judge of its own, has no statistics code, calls the configured api host and ingest host only, and sends no telemetry.
    • Python names: evals.Check, evals.CheckResult, evals.Judge, evals.Case, evals.RisicareEvalError. npm names: defineCheck, RisicareEvalError, and the types Case, Check, CheckResult, Judge, Run, RunSummary, TrialRecord.
    • A function that raises (npm: throws), or a required check that raises, is a failed result. The helper counts it and keeps it out of every rate. A failed optional check posts a score with judge_failed and no value. In npm, the signal option (and SIGINT) cancels the run. The run closes as cancelled, and runDataset rejects with a RisicareEvalError with the code cancelled.
    • Python pytest plugin (entry point pytest11): --risicare-dataset, --risicare-version, --risicare-split, --risicare-trials, --risicare-release, --risicare-prompt, --risicare-external-id. The fixture risicare_eval has run_case(case, function, checks). A test with the argument risicare_case gets one call for each case. The plugin does nothing without --risicare-dataset (or RISICARE_EVAL_DATASET).
    • Command risicare eval gate (Python: console script risicare; npm: the bin of the package). Exit codes: 0 pass, 1 could not decide, 2 usage, 100 a criterion is missed with proof, 101 no verdict (or an unclear criterion under --strict). The gate blocks on proof: an unclear criterion passes unless you set --strict.
    • The holdout is on the client side. A dev run runs dev cases only. A holdout run runs holdout cases only. The helper reads the cases into memory, writes them nowhere, and stops if the api serves a case of the other split.
    • Run binding: evals.run(..., prompt=prompt) (npm: runDataset({ ..., prompt })) takes a prompt from get_prompt. It sends prompt = {name, version, hash} with the run, and runs each trial inside prompt.context() (npm: prompt.run()). The api binds the run to the stored version when the hash equals the content hash of that version. A 422 prompt_hash_mismatch stops the run before any trial. A 422 prompt_hash_invalid does the same. The error says what happened and what to do.
    • The pair prompt=("support", "4") (npm: prompt: { name: 'support', version: '4' }) still works. It sends no hash, and the run binds to nothing.
  • score() carries the failure class, the judge identity, the trial and the experiment id.
    • Python adds seven optional keyword arguments: failure_class, judge_model, judge_version, judge_prompt_hash, judge_failed, trial and experiment_id. npm adds seven optional properties: failureClass, judgeModel, judgeVersion, judgePromptHash, judgeFailed, trial and experimentId.
    • The SDK sends a field only when you set it. A call that sets none of them sends the same body as before.
    • judge_failed=True (npm: judgeFailed: true) posts a result that has no value. The judge or the check ran and gave no result (an error, a timeout, a refusal, an output that it could not parse). Use it with kind="eval" and leave out value. Risicare stores the row and counts it as failed. It is never read as 0 or 1, and it is not billed.
    • The SDK checks the rules of the api at the call. A score that breaks a rule is not sent. The SDK writes one WARNING that names the rule and adds 1 to failed_scores (npm: failedScores).
    • The rules, with the reason that the api writes: judge_model, judge_version, judge_prompt_hash and judge_failed=True need kind="eval" (judge_fields_need_eval). A failed result has no value (failed_has_no_value). trial needs experiment_id (trial_needs_experiment).
    • The bounds: judge_prompt_hash is 64 lowercase hex characters. trial is an integer from 1 to 1000. judge_model and experiment_id have at most 128 characters. judge_version has at most 64. A failure_class is a key of 2 to 63 lowercase letters, digits and underscores.
    • The default kind is still annotation. The SDK does not change the kind when you set a judge field: pass kind="eval" (npm: kind: 'eval').
    • The SDK cannot check that a failure_class is in the vocabulary of your project. The api checks it and answers 422 (unknown_failure_class). These fields are identifiers, as name is. A mask does not see them.

Fixed:

  • Python: the OpenTelemetry bridge reads the current GenAI attribute names. The bridge (RisicareSpanProcessor, RisicareSpanExporter) read only the older names, for example gen_ai.system and gen_ai.usage.prompt_tokens. A span from a new emitter (the Anthropic SDK (beta), Strands, Microsoft Agent Framework, @ai-sdk/otel) reached Risicare with no provider, no token counts and no stop reason, and its kind stayed internal.
    • The bridge now reads the current name first and the older name second. The pairs are gen_ai.provider.name / gen_ai.system, gen_ai.usage.input_tokens / gen_ai.usage.prompt_tokens, gen_ai.usage.output_tokens / gen_ai.usage.completion_tokens and gen_ai.response.finish_reasons (a list; the first item is the stop reason) / gen_ai.response.finish_reason.
    • A span that has both names of a pair keeps the current one. Both names leave the span attributes. A name with no usable value (an empty text, a count that is not a number, an empty list) does not hide the other name. A span with the older names only gives the same result as before. npm has no OpenTelemetry bridge, so this fix has no npm part.

Known limits:

  • Python: pytest-xdist is not supported by the pytest plugin. npm: there is no test-runner plugin for vitest or jest.
  • The spans of the LangChain callback (npm: handler) and the spans that the OpenTelemetry bridge converts do not get the prompt keys from a list. Use prompt.context() (npm: prompt.run(fn)) for those.
  • The OpenTelemetry bridge still does not read gen_ai.operation.name, gen_ai.input.messages, gen_ai.output.messages, gen_ai.tool.* or gen_ai.response.id. They stay on the span as before.

Python 0.8.0 and npm 0.11.0 — 2026-10-26

This release changes how the SDK delivers spans during an outage and how score() treats values. Both SDKs have the same policy and numbers.

Changes that can break an existing caller:

  • Delivery during a gateway outage. The HTTP exporter now keeps a batch through a gateway outage for up to retry_horizon_s (npm: retryHorizonS). The default is 300 s. Python 0.7.0 and npm 0.10.0 gave up after 3 attempts in each of 4 rounds, which is a few seconds.
    • Retried: HTTP 408, 429, 500, 502, 503, 504, a connection error and a timeout. The wait is full-jitter exponential backoff, base 1 s, cap 30 s. A Retry-After header (seconds or, new, an HTTP date) replaces the wait when it is more than 0 s. Its old 10 s cap is gone; the cap is the horizon.
    • Sent once: every other status (400, 401, 403, 404, 422 and the rest), a redirect, a 2xx that is not a Risicare ack, and an ack of 0 and 0. The SDK drops such a batch as transport_refused after its one request. The batch processor no longer puts it back in the queue 3 times.
    • 413: the SDK splits the batch in two, one time. A half that gets 413 again is dropped with the new reason too_large (one WARNING, one time).
    • A batch that is not delivered within the horizon is dropped with the new reason retry_exhausted. A gateway outage that is longer than the horizon loses spans.
    • A full queue now drops the OLDEST queued span (queue_full) and keeps the new one. Through Python 0.7.0 and npm 0.10.0 it dropped the new span.
    • The circuit breaker counts a call that ends refused, or that used up its retries, except when the last answer was 429 or 503. With the default horizon it opens only after five batches in a row were retried for 300 s each. In npm, the half-open probe now follows the policy. Before, it was one attempt with no retry.
    • shutdown() has a new default budget of 10 s (shutdown_timeout_s, npm: shutdownTimeoutS; it was 5 s). It applies at exit (npm: beforeExit), at SIGTERM and, in npm, at SIGINT. A batch that waits for a retry gets one more attempt at once. A failed attempt is not retried, so a dead gateway costs one attempt for each batch, not the budget. docker stop waits 10 s by default: set shutdown_timeout_s (npm: shutdownTimeoutS) lower when your application needs time for its own cleanup.
    • HttpExporter has retry_horizon_s (npm: retryHorizonS). Its max_retries (npm: maxRetries) is now an optional limit on the attempts for one request body. The default is none; it was 3. In npm, attemptsPerExport is undefined without it. Python: export_timeout_seconds is not used and gives a DeprecationWarning. The exporter that otlp_endpoint adds keeps its own retry rules.
    • npm: a retry wait does not keep the process alive, because beforeExit starts shutdown(), which ends it. A flush() that is running when a shutdown() starts now waits for that shutdown.
  • Score v2 changes an existing call. A number outside 0.0 to 1.0 is sent. Through Python 0.7.0 and npm 0.10.0 the SDK refused it at the call. True and False are sent as booleans. Before, they were sent as 1.0 and 0.0. A name longer than 128 characters is refused at the call with a WARNING and counted in failed_scores (npm: failedScores). The api refuses it too. A number that is not finite stays refused.

New:

  • New init() arguments: retry_horizon_s and shutdown_timeout_s. npm options: retryHorizonS and shutdownTimeoutS.
  • New metrics. get_metrics() (npm: getMetrics()) has attempts and oldest_pending_age_s (npm: oldestPendingAgeS). dropped_spans_by_reason (npm: droppedSpansByReason) has retry_exhausted and too_large.
  • Score v2: typed values, kinds and session scores.
    • Python: risicare.score(name=..., value=..., trace_id=None, span_id=None, session_id=None, comment=None, kind="annotation"). npm: score({ name, value, traceId, spanId, sessionId, comment, kind }).
    • value is a finite number (any range), a string of 1 to 256 characters (categorical) or a boolean. kind is annotation, eval, feedback or outcome. The default is annotation.
    • A score can be on a session (session_id, npm: sessionId) with no trace.
    • The request body is the v2 body of POST /v1/scores: value and kind, and no score field.
    • The positional form still sends the score: score(trace_id, name, value) in Python and score(traceId, name, value, { spanId, comment }) in npm. The first such call in the process writes one WARNING.
  • The user, session, release and tags of a trace.
    • risicare.set_user(id), set_session(id), set_release(version) and add_tags([...]) (npm: setUser, setSession, setRelease and addTags) write user.id, session.id, risicare.release and tag.tags (a list). They write on the current span, and on each other span of the same trace that ends after the call (also the open root span), unless that span has the attribute already. A span of another trace never gets them.
    • Outside a span, a helper sets nothing, returns False (npm: false) and writes one WARNING. The SDK keeps the values of the last 10,000 traces.
    • init(service_version=...) (npm: init({ serviceVersion })) or RISICARE_SERVICE_VERSION is the no-code route for the release. It puts service.version on every span.

Python 0.7.0 and npm 0.10.0 — 2026-10-23

Both releases change a default and the values of some attributes. In 0.x the minor number is the breaking signal, so both are minor releases.

Changes that can break an existing caller:

  • Prompt and completion content is captured by default. If you upgrade and change nothing, init() now sends the text of your prompts and completions to Risicare, and Risicare stores it.
    • From Python 0.2.2 to 0.6.3 (npm 0.5.2 to 0.9.2), this text stayed in your process unless you set trace_content=True (npm: traceContent: true) or RISICARE_TRACE_CONTENT=true. Now the default is on.
    • This covers the provider patches, in Python the framework integrations, and the content keys that you set by hand, for example span.set_attribute("gen_ai.prompt.0.content", ...) (npm: span.setAttribute(...)). In npm, only patchOpenAI and patchAnthropic write prompt and completion text. The other providers write none, as before.
    • The SDK sends the model, the token counts, the latency, the cost, the roles, the errors and your own attributes in both cases, as before.
    • Python: with debug=True, the console exporter now prints this text too. The text also goes to the exporters in exporters=[...] and to an otlp_endpoint. With the OTel bridge, the content keys of other OpenTelemetry instrumentations now pass the SDK unchanged.
    • To keep the old behaviour, turn capture off: risicare.init(trace_content=False) in Python, init({ apiKey: process.env.RISICARE_API_KEY, traceContent: false }) in npm, or RISICARE_TRACE_CONTENT=false.
    • The argument wins over the environment variable, in both directions. When the variable is set, Python reads a value other than true, 1, yes or on as off. npm reads a value other than true, 1 or yes as off (on does not turn it on). When the variable is not set, the default applies.
    • Since npm 0.19.0, on turns RISICARE_TRACE_CONTENT on, and the other switch words change too. See Python 0.16.0 and npm 0.19.0.
    • With capture off, the SDK replaces each content-keyed attribute with <risicare:content-omitted>.
    • The project switch: you can also turn off content capture in the project settings. The gateway then drops the content of that project, also when the SDK sends it. The SDK switch stays. Use it when prompt and completion text must not leave your process, because the project switch acts after the text has left.
    • With capture off, the SDK still sends the status message, the exception message, the stack trace (which repeats the message), error.message and exception.message. Only the project switch masks them, at the gateway. Error diagnosis needs them, and an error message can contain part of a prompt.
    • A second init(): the first init() still wins. When a later init() gives a different trace_content (npm: traceContent), the SDK writes a WARNING (npm: a console warning) that names both values. Call shutdown() first to change it.
  • With capture off, the SDK strips the content keys of more frameworks. This applies only when trace_content=False (npm: traceContent: false). The SDK now uses the same rule as the ingest gateway. Before, it sent these keys, and only the gateway removed them. Now it replaces their values with <risicare:content-omitted> before the span leaves your process.
    • Vercel AI SDK: ai.prompt, ai.prompt.messages, ai.prompt.tools, ai.response.text, ai.response.object, ai.response.toolCalls, ai.response.reasoning, ai.response.files, ai.toolCall.args, ai.toolCall.result, ai.value, ai.values and the older ai.result.text, ai.result.object and ai.result.toolCalls.
    • Google ADK: gcp.vertex.agent.llm_request, gcp.vertex.agent.llm_response, gcp.vertex.agent.tool_call_args, gcp.vertex.agent.tool_response and gcp.vertex.agent.data.
    • Pydantic AI: pydantic_ai.all_messages, final_result, model_request_parameters, tool_arguments and tool_response.
    • OpenLLMetry CrewAI: each key that starts with crewai.. The SDK keeps a key whose last segment names a role, a name, an id, a type, a model, a count, a length or a token count, for example crewai.agent.role and crewai.crew.task_count. It also keeps crewai.agent.llm (a model name) and crewai.crew.process (sequential or hierarchical).
    • Mastra: mastra.<span type>.input and mastra.<span type>.output. OpenInference, OpenLLMetry and Semantic Kernel: agent.goal, agent.backstory, llm.tools, llm.available_functions, gen_ai.task.input, gen_ai.task.output and sk.available_functions.
    • Lists of tool definitions: the description, parameters and json_schema of each tool in llm.tools.*, llm.request.functions.* and gen_ai.tool.definitions.*, and tool.parameters. The SDK keeps the description of one tool on a tool span (tool.description). Also the arguments of a LiteLLM function call (gen_ai.completion.<i>.function_call.arguments) and the text of an OpenInference prompt (llm.prompts.<i>.prompt.text).
    • Span events: an event named gen_ai.user.message, gen_ai.system.message, gen_ai.assistant.message, gen_ai.tool.message or gen_ai.choice, or a name that starts with gen_ai.content., holds one message. The SDK now replaces the value of each attribute of such an event. It keeps only gen_ai.system, gen_ai.provider.name, the keys of the exact KEEP list (for example gen_ai.response.content_type), and a key whose last segment the KEEP rule names (for example role, id, index and finish_reason). The event name does not change.
    • Request parameters (llm.invocation_parameters): the SDK keeps the key, and it reads its value as a JSON object or as the JSON text of a JSON object. It replaces the value of each of these keys with the marker, at every depth: additional_instructions, chat_history, contents, documents, functions, input, input_text, instructions, message, messages, preamble, prediction, prompt, system, system_instruction, texts, tool_config and tools.
    • A key also matches after the SDK turns A to Z into lower case and removes each _, so systemInstruction, SYSTEM and inputText match. A dotted key matches when one of its parts matches. Other entries follow the key rule: extra_body.metadata.content gets the marker, and temperature, max_tokens and response_format stay.
    • Text that starts with { or [ is JSON text. The SDK reads it with the same rule. When the text is not valid JSON (for example text that was cut, or a stop sequence such as [/INST]), the SDK replaces it with the marker. When the value is not a JSON object, the SDK replaces the whole value with the marker.
    • If a dashboard or a custom exporter reads one of these keys while capture is off, it now gets the marker.
  • Python: structured content is JSON, not a Python repr. With trace_content=True, six attributes hold JSON when the value is a list, a tuple, a dict or a pydantic model: LiteLLM gen_ai.request.messages; DSPy gen_ai.request.messages and gen_ai.response.content; LangChain gen_ai.prompt.content and gen_ai.completion.content of a chain, and agent.action.input of an agent action with a dict input. A string and any other object keeps its old form. The names do not change. A reader that parsed the old Python repr must change.
    • The input and output previews of a LangChain chain span now show JSON text. An object whose str() raises now gives ... [truncated]. Before, the error reached LangChain, and the chain span was lost.
    • A LangChain tool span: tool.input is the JSON of the arguments when they are a dict, and tool.output of a ToolMessage is JSON with its content, name and tool_call_id. A list, a dict or a model result is JSON. A string input or result keeps its form. With capture off, the spans keep only tool.input_length and tool.output_length, as before.
    • Instructor and Pydantic AI gen_ai.response.content is JSON for a pydantic model, a list, a tuple or a dict. For example, name='Jason' age=25 becomes {"name": "Jason", "age": 25}. CrewAI framework.crewai.result is the JSON of the model or dict when the output has output_pydantic or output_json. CrewAI framework.crewai.agent_output is JSON when the task has output_pydantic. For a result whose __str__ raises, the value is ... [truncated].
    • A long value is valid JSON of at most 10,000 characters. Before, the SDK cut the text at 10,000 characters, so a long value was not valid JSON. Now it cuts the longest strings first (each ends in ... [truncated]). If that does not fit with each string at 200 characters, each long list keeps its first and last items, with ... [truncated] as one item between them. If that does not fit either, the value is one JSON string with the start of the JSON text.
    • A lone UTF-16 surrogate becomes U+FFFD, because the ingest gateway refuses a batch that contains one. A list or dict that contains itself is written [...] or {...}.

New:

  • Cached and reasoning token counts on the LLM span, when the provider response gives them. The SDK uses the OpenTelemetry GenAI names.
    • gen_ai.usage.cache_read.input_tokens: the input tokens that the provider read from its prompt cache.
    • gen_ai.usage.cache_write.input_tokens: the input tokens that the provider wrote to its prompt cache. OpenTelemetry renamed this key from cache_creation to cache_write on 2026-08-20. The SDK uses the new name.
    • gen_ai.usage.reasoning.output_tokens: the output tokens that the model used for reasoning.
    • OpenAI chat.completions.create (Python sync and async; npm patchOpenAI), with and without streaming: usage.prompt_tokens_details.cached_tokens, usage.prompt_tokens_details.cache_write_tokens and usage.completion_tokens_details.reasoning_tokens. A stream gives them only in its usage chunk, so set stream_options={"include_usage": True} (npm: stream_options: { include_usage: true }).
    • Anthropic messages.create (Python sync and async; npm patchAnthropic), with and without streaming: usage.cache_read_input_tokens, usage.cache_creation_input_tokens and usage.output_tokens_details.thinking_tokens. A stream gives them in message_start and in message_delta. The counts of message_delta are cumulative, so a count there replaces the count of message_start.
    • Python only: LiteLLM completion and acompletion, with and without streaming, give the same three fields as OpenAI in LiteLLM's Usage object. A stream gives them only in the usage of its last chunk, so set stream_options={"include_usage": True}.
    • The SDK sends a key only when the response gives an integer for its field. A real 0 is sent. When the response gives no count, or null, the key is absent. The SDK does not calculate or estimate a count.
    • gen_ai.usage.prompt_tokens, gen_ai.usage.completion_tokens, gen_ai.usage.total_tokens and the cost do not change. The OpenAI prompt count includes the cached tokens. The Anthropic input_tokens does not include the cache tokens, and the SDK sends it unchanged. LiteLLM adds the Anthropic cache tokens to its prompt count.
    • The three keys are not content: trace_content=False keeps them.

Fixed:

  • Your own dicts are not changed. The content gate replaced values in place, so the dict (npm: object) that you gave to add_event() and add_link() (npm: addEvent() and addLink()) was changed too. The gate now strips a copy. The span that is sent is stripped as before.
  • Content capture never fails a call because of a message that it cannot read. With trace_content=True, the SDK read the role and the text of your messages before it called the provider. When that reading raised, your call raised and the request was not sent. Examples: a dict subclass whose get() raises, a message object whose role property raises, an Anthropic text block with "text": None. In npm, patchOpenAI and patchAnthropic had the same fault, for example with a class instance whose role getter throws.
    • Python providers that read messages: OpenAI, Groq, Cerebras, Together, Anthropic, Mistral, Hugging Face, Ollama and Bedrock. Now the SDK reads in the same guard as its reading of the response. Your call goes to the provider with the messages unchanged.
    • The span gets risicare.observer_error with the exception class name. The message attributes read before the error stay on the span. The rest of that message and the messages after it are not recorded. The span status does not change.
    • Python: Ollama, Hugging Face and Bedrock now read messages with the same rule as the other providers: only a sequence (a list, a tuple, a deque), the first 10 without a slice, a Mapping with get() and any other message with getattr(). Cohere chat counts the chat history (gen_ai.prompt.history_count) only when it is a sequence.
  • Python: a message object or a deque of messages no longer breaks the call. With trace_content=True, a call that sent response.choices[0].message back to OpenAI (sync and async), Groq, Cerebras or Together raised AttributeError. A collections.deque of messages raised TypeError for OpenAI, Groq, Cerebras, Together, Anthropic and Mistral. Now the call goes to the provider.
    • The SDK reads the messages only when they are a sequence. A one-shot iterable such as a generator is not read, so it reaches the provider complete, and the span has no message attributes. Before, such a call raised TypeError. With trace_content=False the span then has no gen_ai.prompt.count.
  • Python: content capture no longer fails a call when it reads a framework result or request that raises. This covers Instructor, CrewAI, Pydantic AI, AutoGen 0.2 and 0.4, OpenAI Agents, LangGraph, the LangChain callbacks, LiteLLM, Google and Vertex AI, Anthropic, Ollama and Hugging Face. The SDK now does these reads in a guard. When a read raises, the span gets risicare.observer_error with the exception class name, and the span status does not change.
    • A message list, a new_items or a chat_history that has no length (a generator) is not read, so the SDK does not consume it. An AutoGen 0.2 recipient whose read raises gets the name unknown.
    • A pydantic model keeps its iterators, serializers and hidden fields. A model that holds a one-shot iterator is recorded as its str() text. Any other model is recorded with model_dump(mode="json"), so its own serializers apply. A field with repr=False is left out at every depth.
  • Python: LlamaIndex content capture no longer empties a streaming response. With trace_content=True, a query engine with streaming=True gave you an empty response.response_gen. An aquery() with streaming=True stopped your event loop until the stream ended. A stream_chat() whose stream was complete before the span ended gave you the text as one chunk. Now you get the stream as LlamaIndex sends it. The spans that end with such a result have no gen_ai.response.content. This also holds for a workflow StopEvent that holds such a result.

Known limits:

  • Warning, Python: through LiteLLM, the SDK sends the values of LiteLLM's Usage object, and LiteLLM writes some values that the provider did not give (LiteLLM 1.101.0 and 1.106.2). For an Anthropic model, LiteLLM writes 0 for a cache count or a reasoning count that Anthropic does not give. When Anthropic gives no reasoning count but the answer has thinking text, LiteLLM estimates the count from that text. For a stream of a text answer, LiteLLM writes a reasoning count of 0 when the provider gives none. The SDK cannot tell these values from the provider's own values.
  • The other providers do not send the three cache and reasoning keys yet.

Python 0.6.3 and npm 0.9.2 — 2026-10-20

The package change logs mark none of these changes with a warning sign. Some change what you see, and each item says what changed.

Fixed:

  • Python 0.6.3: a LiteLLM stream's span is in the flush() that you call right after the loop (issue #58). For litellm.completion(stream=True) or acompletion(stream=True), LiteLLM ended the span on its own thread or task after your loop ended. A flush() right after the loop could return True without that span (19 of 20 sync trials on LiteLLM 1.101.0). Now the SDK ends the span on your thread when your loop reads the stream to its end.
    • The token counts now come only from the usage that LiteLLM puts on the last chunk. LiteLLM does this when you set stream_options={"include_usage": True}. Without that option, the stream span has no token counts and no cost. Before, the span had LiteLLM's own numbers. A stream that you do not read to its end does not change.
  • Python 0.6.3: LiteLLM 1.63.7 async fallback (issue #100). With LiteLLM 1.63.7 (the version that dspy==2.6.17 installs), an acompletion() call with fallbacks= recorded the error span of the failed model but no span for the model that answered. Now the SDK ends the one open attempt that got the answer, as ok, with the token counts. When it finds more than one such attempt, it ends none, as before.
  • Python 0.6.3: a traced stream that is still open at exit or at shutdown() exports its span (issue #65). This holds for a provider stream (stream=True with OpenAI, Anthropic, Groq, Cerebras, Together or Google). Before, the LLM call was missing from the trace. Now shutdown(), the interpreter exit and the SIGTERM handler end each open stream span before the export stops. The span has stream.end_reason = "shutdown", the chunk data read until then, and no status (unset). A status that was set before (an error) stays. The provider stream stays open, and the span does not end a second time.
  • Python 0.6.3: OpenAI with_streaming_response read with iter_lines() or iter_bytes() gave no span (issue #71). The same holds for with_raw_response. Now the span ends when the response closes (the with block exit or close()) or when you drop the response. The span is ok and has no chunk data and no token counts. The parse() path does not change.
  • Python 0.6.3: a streamed LlamaIndex LLM call gave a provider span too (issue #82, part 2). Now the provider span is suppressed while the stream body runs, so each streamed call gives one LLM span. A provider call that your code makes outside the stream keeps its span.
  • Python 0.6.3: Pydantic AI 2.x agent span (issue #84). The span now has framework.pydantic_ai.result_type (the name of the output type; the default str is left out) and framework.pydantic_ai.tools (the tool names). An agent without a name now gets the name that pydantic-ai infers from your variable. Before, the name was "instance" after run() or run_sync(), and none after run_stream().
  • Python 0.6.3: userinfo and a query in an endpoint (issue #69). init(endpoint=...), init(api_endpoint=...), RISICARE_ENDPOINT and RISICARE_API_ENDPOINT now keep the scheme, host, port and path of a value and nothing else. Before, http://user:pass@host made httpx send Authorization: Basic in place of the Bearer key, and httpx printed the userinfo in its INFO line. A query (https://host/base?x=1) gave the path /base?x=1/v1/spans.
    • init() now removes userinfo, a query and a fragment from each host it uses, and logs one WARNING for each host. The WARNING names the kinds that were removed and never the removed text. init() does not raise. Put the key in api_key, not in the URL. HttpExporter(endpoint=...) called by hand is not changed.
  • Python 0.6.3: the DISCARDED WARNING names the cause (issue #56). Before, it always said "check the api_key and the endpoint". Now it names the cause of the last failed round, for example "the endpoint answered HTTP 401: check the api_key and the endpoint" (or 403), "the endpoint answered HTTP 500: check the endpoint and the server", "the endpoint answered HTTP 429 (over capacity): the server shed load; the spans were retried and then dropped" (or 503), "the endpoint accounted for 0 of N span(s)" or "the endpoint did not answer". It names the api key only for a 401 or 403. When the cause is not known (for example a custom exporter), the text does not change.
  • Python 0.6.3: a second SIGTERM during the SDK's drain reaches your SIGTERM handler (issue #93). When your application installs its own SIGTERM handler before init(), the SDK drains first and then calls your handler. Before, a second SIGTERM during the drain was dropped. Now the SDK calls your handler one more time for each SIGTERM that arrived during the drain, after the drain. Your handler does not run during the drain. A SIGTERM that arrives while your handler runs is dropped, as before.
  • Python 0.6.3: a flush() that ends while scores wait counts them before it returns (issue #54). Before, such a flush() returned False with failed_scores still at 0, and the next flush() returned False again for the same loss. Now the flush() that ends them counts them and logs one WARNING with their number. The next flush() with no new loss returns True.
  • npm 0.9.2: the transport_refused WARNING gives the number of HTTP requests that the SDK sent (issue #57). Before, it said "up to 12 HTTP requests: 3 in each round". Now it says, for example, "after 4 failed export rounds each (4 HTTP requests sent)", or a range such as "7 to 9 HTTP requests sent" when the spans in one WARNING had different totals. A round with an open circuit breaker sends 0 requests. A custom exporter that has no takeAttempts(spans) method keeps the "up to" text, from its attemptsPerExport. takeAttempts is a new optional member of the SpanExporter interface.
  • npm 0.9.2: a second patch of the same client gives no second span (issue #67). patchOpenAI(patchOpenAI(client)) made two LLM spans with the same name for one call. Now each patch* function returns an already patched client unchanged. This holds for patchOpenAI, patchAnthropic, patchBedrock, patchCerebras, patchCohere, patchGoogleAI, patchGroq, patchHuggingFace, patchMistral, patchOllama and patchTogether. A different client still gets its own proxy. patchVercelAI() takes no client and does not change.

Known limits:

  • Python: Pydantic AI tool calls still do not get spans of their own.
  • The npm SDK does not remove userinfo and a query from an endpoint yet.

Python 0.6.2 — 2026-10-17

A patch release of the Python SDK.

Fixed:

  • Python 0.6.2: DSPy 2.6.13 to 2.6.18 gave two LLM spans for one LM call (issue #99). These DSPy releases send their LM callback two times for one call. Now each call gives one dspy.lm/<model> LLM span, with the token counts.
  • Python 0.6.2: DSPy before 3.3, an interrupted call has the cancel marker. An LM, module or tool call stopped by KeyboardInterrupt or asyncio.CancelledError now has risicare.cancelled and risicare.cancel_type, as with DSPy 3.3 and later. The status stays unset: a cancel is not an error.

Python 0.6.1 and npm 0.9.1 — 2026-10-17

A monthly-quota discard is no longer an error. The SDK pauses and asks again later.

Changes that can break an existing caller:

  • A monthly-quota discard is not an error. When your organisation has used its monthly event quota, the ingest gateway answers 200 with reason: "monthly_quota_exceeded", the header X-Risicare-Quota: exceeded, resetsAt and retryAfterSeconds (300), and discards the batch. The OTLP form is partialSuccess.errorMessage that starts with monthly_quota_exceeded. Before, the SDK counted every such batch as rejected_spans (npm: rejectedSpans), wrote one WARNING for each batch, and sent the next batch at once. Now, for this reason only:
    • The batch is not retried and is not an error. It does not count toward the circuit breaker, and failed_exports (npm: failedExports) does not change.
    • The exporter pauses for retryAfterSeconds (300 s if the answer has none). It never waits until resetsAt. A value outside 1 s to 3600 s, or one that is not a usable number, is cut to that range or becomes 300 s. In npm, the pause uses a monotonic clock (performance.now()), so a change of the system clock does not lengthen it.
    • During the pause the SDK sends no request. Spans that end wait in the existing bounded queue (Python default: 10,000 spans). The SDK keeps the most recent spans: when the queue is full in the pause, it drops the oldest.
    • After the pause, the SDK sends one batch as a probe. When the backend accepts, the queue drains. When the quota allows spans again, the SDK sends again within minutes, and nothing new is lost unless the queue overflows. A probe that is discarded again is dropped, and the pause starts again.
    • A pause ends after 3 accepted batches in a row, not 1, because the gateway can let one batch through while the quota is still used up. The SDK then writes one INFO, at most once an hour.
    • flush() returns False (npm: false) at once in the pause when spans are queued. It does not wait for its timeout. In Python, the same holds for the OpenTelemetry bridge's force_flush(). A process that exits in the pause loses the queued spans as shutdown_residue, and the WARNING names the quota.
    • The SDK writes one WARNING when the pause starts (with resetsAt and the retry interval), and at most one more each hour for the life of the process. It carries the number of spans dropped for the quota since the last WARNING. The "Span queue full" WARNING is not written for these drops.
    • The SDK counts the spans that the quota dropped as quota_exceeded: get_metrics()["dropped_spans_by_reason"]["quota_exceeded"] and get_metrics()["dropped_quota"] (npm: getMetrics().droppedSpansByReason.quota_exceeded and getMetrics().droppedQuota). It counts a span only when a discarded batch is dropped or the queue overflows in the pause. These spans are not in rejected_spans. A drop is a loss, so one flush() returns False, as for every other loss.
    • Alerts: the deprecated flat dropped_spans (npm: droppedSpans) includes these spans, so an alert on dropped_spans > 0 fires at the quota. An alert on rejected_spans (npm: rejectedSpans) no longer fires for a quota discard. Before 0.6.1 (npm: 0.9.1) it did.
    • Python: this holds for the HTTP exporter and for the OTLP exporter (otlp_endpoint, when it points at the Risicare gateway). With more than one exporter, the pause applies only when every exporter that delivers is paused. Beside an exporter that is not paused, the paused one still drops the batches that it gets.
    • npm: the pause applies only when every exporter that delivers is paused. The SDK has one HTTP exporter, so this matters for a custom exporter only.
    • X-Risicare-Quota: exceeded alone counts as a discard only when the body does not show stored spans (accepted > 0). Every other rejection reason and every other answer behave as before.

New:

  • get_metrics()["dropped_quota"] (npm: getMetrics().droppedQuota) shows how many spans the quota cost you. You need not change anything else.
  • Python: a custom exporter can use the same count. On a SUCCESS result, set last_ack = (0, 0) and last_quota_dropped = <spans>, and give a quota_paused() method that is True while it cannot send.

Compatibility: an SDK older than Python 0.6.1 or npm 0.9.1 keeps its old behaviour: it sends every batch, and the gateway discards it.


Python 0.6.0 and npm 0.9.0 — 2026-10-07

Python risicare 0.6.0 needs risicare-core 0.1.8 or later, the same as 0.5.0 (risicare-core has no new release). Both releases change a return value or a behaviour that an existing caller can see, so the minor number changes: a pin such as risicare~=0.5.0 or risicare@^0.8.0 does not take them. The package change logs list each of these as a change that you can see: the Python change log marks them with a warning sign, and most of the JavaScript ones say "Can break an existing caller".

Changes that can break an existing caller:

  • flush() also tells the truth in a signal handler and after shutdown(). Before, it could return true with spans not delivered.
    • Python: when your own SIGTERM handler is installed before init(), the SDK drains first and then calls your handler. A flush() in that handler returned True also when the drain lost spans or the backend rejected some. A flush() after shutdown() returned True after a drop or a rejection. Both now return False, one time.
    • JavaScript: a flush() after the SDK's own drain started (your SIGTERM or SIGINT listener, registered after init()) returned true at once with the batch still in flight. It now waits for the drain, inside its own deadline, and returns what the drain delivered. A flush() after shutdown() returned true after a drop or a rejection. It now returns false, one time.
    • To see which loss it was, read get_metrics() / getMetrics(): dropped_spans_by_reason, rejected_spans, failed_scores. A flush() that is false at its deadline while none of them went up since the previous flush() means that the spans are still in flight. failed_exports / failedExports is not a loss counter: it counts export calls that failed as a whole, and a later round can still deliver those spans.
  • A shutdown that left spans makes one flush() false, not every flush(). The spans that shutdown() could not deliver count as shutdown_residue.
    • Before, every flush() after such a shutdown returned false for ever. Now the first one returns false and the next one true, as for every other loss.
    • A span can end after the SDK's drain, or your shutdown(), has stopped taking spans (for example in your SIGTERM handler). It is counted as shutdown_residue too. The first such span writes one WARNING, and one flush() returns false. Before, such a span was dropped with no count and flush() returned true.
    • A span that ends while the drain still runs is delivered (in Python, delivered or counted).
    • In Python, a span that you start after shutdown() has returned is not made. A call to a traced provider in your handler after the drain makes no span. Nothing counts them, so a true does not show that they were traced.
    • In JavaScript, a span that you start after shutdown() has returned is made, and it is counted as shutdown_residue.
  • A score that score() refuses counts as a failed score. A value outside 0 to 1 (or not a number), an empty trace id or an empty name was logged and not sent, and flush() stayed true. It also adds 1 to failed_scores / failedScores now, so the next flush() returns false, one time. It does not count when the SDK is not active.
  • With no API key (and, in Python, no exporter of your own), nothing is sent, tracing is off, and is_enabled() / isEnabled() and flush() return False / false. RISICARE_TRACING=true, enabled=True and enable() cannot turn tracing on without a key. init() writes one WARNING that says so (none when you turned tracing off on purpose), and nothing is counted as exported or dropped. Before: Python returned True for both and sent no request (it built no exporter). JavaScript, with RISICARE_TRACING=true, created spans, queued them and dropped them after four export rounds as transport_refused, and flush() returned false once and then true. An exporter that you name yourself (otlp_endpoint, exporters=[...] in Python) still delivers without a key.
  • flush() returns False before init() and with tracing off (enabled=False, RISICARE_TRACING=false). Before, it returned True. If you call flush() on purpose with tracing off, check is_enabled() first.
  • debug with no key counts nothing. Python debug=True still prints the spans (unredacted, for local development only), but they are neither counted nor delivered: exported_spans stays 0 and flush() returns False. JavaScript debug: true prints no span (it still writes the SDK's own debug lines). Before, the printed spans counted as exported and flush() returned True.
  • is_enabled() / isEnabled() is False after the SDK's own signal drain (Python: SIGTERM; JavaScript: SIGTERM or SIGINT). Before, it stayed True over a processor that was shut down. In Python, enable() after init(enabled=False) also no longer makes is_enabled() True, because nothing was started; the JavaScript SDK behaves differently in this case, and that difference is open: do not rely on enable() after enabled was false.
  • Python: an HttpExporter with no key sends nothing and is left out. init() logs one WARNING that names the cause. A setup that worked can stop: init(api_key=KEY, exporters=[HttpExporter(endpoint=<your own relay>)]) sent spans to your relay in 0.5.1, because the exporter had no key of its own. Now init() leaves the exporter out, is_enabled() and flush() are False, and nothing is sent. Give the exporter its own key: HttpExporter(endpoint=..., api_key=...). The init() key goes only to an exporter whose endpoint is the endpoint of init().
  • A key that is only whitespace is no key, in both SDKs. The SDK trims the key (the characters that JavaScript's trim() removes, a byte order mark included). An empty or blank api_key / apiKey argument counts as "not given", so RISICARE_API_KEY applies. In JavaScript, an empty apiKey option won over the variable before. To turn tracing off, set enabled to false, not an empty key.
  • JavaScript: your SIGTERM or SIGINT listener runs once, in both orders of registration. When your listener was registered after init(), the SDK raised the signal again after its drain, your listener ran twice, and, if it was still running 100 ms later, the SDK ended the process with exit code 143. Now, when your application has a listener at the moment the signal arrives, the SDK does not raise the signal again and does not end the process: your listener decides the exit. If you relied on the exit code 143, call process.exit(143) yourself. Register the listener before init() if it makes spans that must be delivered.
  • The WARNING for "no API key" has new words (both SDKs). Python no longer prints the "Tracing active" line with no key, and an import with RISICARE_TRACING=true and no key now logs the same WARNING (before, it logged nothing). Code that matches the old text must change.

Fixed:

  • Python: get_metrics(), is_enabled() and flush() no longer wait for an internal lock. A SIGTERM handler that called one of them while the main thread was inside shutdown() waited for ever.

Documented: a new init() starts a new count: report a loss with flush() or get_metrics() before you call init() again. In Python, with more than one exporter that counts as delivery (otlp_endpoint, an exporter of your own, the Risicare exporter), the first exporter that succeeds decides a batch, so flush() returning True means that at least one of them acknowledged each span.


Python 0.5.1 — 2026-10-04

A patch release of the Python SDK (npm stays 0.8.0, risicare-core stays 0.1.8). It fixes four faults of 0.5.0:

  • Pydantic AI: Agent.run_stream() no longer raises TypeError. The call works with the SDK active, and you get the Pydantic AI result object. The agent span opens when the block starts and ends when the block ends. Its status is error when your code raises inside the block.
  • LangChain: a classic AgentExecutor run that calls a tool is one trace, and the AgentExecutor span is its root. Before, the span was lost and the run arrived as one trace for each tool call plus one. The agent_action span is a point in time: it starts and ends when the agent chooses the tool.
  • LlamaIndex: the spans of one run are one trace. Before, every span was the root of its own trace. A span with no LlamaIndex parent joins the active Risicare span, session or agent.
  • extend_span_ttl is exported from risicare (from risicare import extend_span_ttl). Before, you imported it from risicare_core.

Not fixed in 0.5.1, and still true in 0.6.0: Pydantic AI tool executions have no span, and the agent span does not record the output type; a streamed LlamaIndex LLM call still gets a provider span next to the LlamaIndex span. Python 0.6.3 fixed the output type and the LlamaIndex provider span. Pydantic AI tool executions still have no span.


Python 0.5.0 and npm 0.8.0 — 2026-10-04

Python risicare 0.5.0 needs risicare-core 0.1.8 or later (the three packages were published on 2026-10-04). Python 0.4.1 and npm 0.7.1 were not published: their changes are in these releases.

Changes that can break an existing caller (a selection; the change logs of the packages mark each one "Can break an existing caller"):

  • flush() tells the truth (0.5.0 and 0.8.0; the signal-handler, shutdown() and no-key cases changed again in 0.6.0 and 0.9.0, see above). It returns true only when all of these hold:

    • no span is in the queue or in an export;
    • no span was dropped, rejected or left out of an acknowledgement since the previous flush() returned;
    • no score failed since the previous flush() returned.

    The other rules of flush():

    • A loss makes the next flush() return false one time.
    • flush() returns at its timeout (default 5000 ms). It only waits: it does not stop a request that is already sent. To end a process in a fixed time, call shutdown(timeout).
    • After a shutdown() that left spans undelivered, flush() returns false.
    • With more than one exporter, a batch counts as delivered when the first exporter takes it. So flush() can return true while another exporter refused the batch.
    • In JavaScript, the root flush(timeoutMs) and shutdown(timeoutMs) take a timeout.
  • New counters. exported_spans / exportedSpans counts only the spans that the backend accepted. A partly rejected batch no longer counts in full. New: rejected_spans / rejectedSpans, failed_scores / failedScores, and the drop reason unacknowledged (spans that could not be serialized, or that the acknowledgement left out). An acknowledgement with 0 accepted and 0 rejected is a failure: the batch is tried again, and then dropped as transport_refused.

  • Python init(): every parameter after api_key is keyword-only. A positional call with two or more arguments raises TypeError.

  • JavaScript Span and Tracer are types only. Use import type { Span, Tracer }.

  • A traced call returns a proxy. Python: a traced stream=True call to OpenAI, Anthropic, Groq, Cerebras or Together returns a proxy of the provider's stream object, not a generator (inspect.isgenerator() is False). JavaScript: a traced call returns a Proxy of the provider's promise (OpenAI, Anthropic, Groq, Together, Cerebras, Cohere) or of the stream (Google, Mistral, Ollama), and util.types.isPromise() is false for it.

  • Provider states in get_instrumented_modules(): a patched provider is instrumented and one whose patch raised is failed (before: attempted for both). New state pending: the module is imported, but the module that holds its patch points is not.

  • Guard fixes (only with the fix runtime on, which is held during the beta): Python: a guard that fails now stops the call. Python and JavaScript: a blocked pattern that is not usable rejects the call.

  • JavaScript stored names change. An agent() with no name uses the function name (before: agent). A phase span with no name is <phase>:<function>, for example think:analyzeQuery (before: phase:think).

  • The host for scores and fix reads is chosen in this order: the api_endpoint option; the endpoint option, unless it is the default ingest host; RISICARE_API_ENDPOINT; RISICARE_ENDPOINT, when no endpoint option is given and it is not the default ingest host; https://api.risicare.ai. The default ingest host never names the scores host. For the hosted service, set no endpoint.

  • RISICARE_TRACING is trimmed and case is ignored. true, 1, yes and on turn tracing on; false, 0, no and off turn it off; an empty value is no value; any other value turns tracing off with one WARNING.

  • Python Tier 0 (import risicare with RISICARE_TRACING on) uses the defaults of init(): environment development and no service name. Before, it sent production and the service name default.

  • JavaScript error codes are the same as the Python codes on a shared set of 147 error inputs. Some JavaScript errors get a more specific code, for example ORCHESTRATION.LIFECYCLE.CRASHED for "worker process crashed" (before: TOOL.EXECUTION.CRASHED). Dashboards and alerts that use the old JavaScript codes can change.

  • Python process pools: in a pool worker, call risicare.flush() at the end of each task. A forked child no longer keeps the SIGTERM handler of the parent, so a pool no longer hangs in pool.terminate() (a very rare case remains). pool.terminate() and the end of a with Pool() block end the workers with SIGTERM, and without that call the spans that a worker made since its last export (every 1 s by default) are lost. A pool that ends with close() and join(), and a ProcessPoolExecutor, were not affected in our test (macOS, Python 3.13). The main process keeps its exit handler and its SIGTERM flush.

Fixed (selection):

  • Python: a provider library that you import after init() is traced, so the import order no longer matters. (A library that you import only with importlib.import_module is patched at its next import statement.)
  • Python: Mistral is traced (chat completions, sync and async; streaming calls are not traced).
  • Python: a traced stream=True call keeps the stream object of the provider (OpenAI, Anthropic, Groq, Cerebras, Together; for Google the response object). with ... as stream: works, and LangChain stream() works.
  • score() reports a failed request: one WARNING and the failed_scores / failedScores counter. A redirect counts as a failure. In Python, a normal exit and SIGTERM wait up to 2.5 s for score requests that are not complete.
  • Python: traced_stream() and traced_stream_sync() end the span when the stream completes, raises or is closed.
  • Python: the OTLP exporter lets one call through after the cooldown of its circuit breaker.
  • With traceContent: true, the JavaScript patchOpenAI and patchAnthropic capture the prompt and completion text (a streamed call gives the prompt only; other JavaScript providers capture no text).
  • A 401 or 403 is not sent again inside one export round: one span against such an endpoint gives 4 requests (before: 12). The SDK removes its API key from the text that it logs (a secret that you put in the path of a URL is logged as you gave it).

Known issue, Python only (in 0.4.0 and every release before it; not changed in 0.5.0, 0.5.1 or 0.6.0): an ended span can stay the current span. When a generator that holds an open span is closed in another task or thread (for example an async generator that is not read to its end), or when a span that was opened inside another one exits after it, later spans in that thread or task become children of the ended span. Read a traced stream or generator to its end inside the span that started it, or close it there.

Licence: risicare-core 0.1.8 has the proprietary licence of risicare 0.4.0 and later (see the LICENSE file in the package). risicare-core 0.1.7 and earlier were published under the MIT licence.

The full lists are in the change logs of the packages.


Python 0.4.0 and npm 0.7.0 — 2026-09-26

The two releases have the same behaviour changes. Read them before you upgrade.

Two hosts. The SDK sends spans to the ingest gateway and scores to the API:

DataDefault hostOption (Python / JavaScript)Environment variable
Spanshttps://ingest.risicare.aiendpoint / endpointRISICARE_ENDPOINT
Scores (and fix reads)https://api.risicare.aiapi_endpoint / apiEndpointRISICARE_API_ENDPOINT

During the beta, an API key can send scores to the API host. The route of fix reads was not reachable with an API key until 2026-11-06.

Earlier releases sent all data to https://app.risicare.ai, which is the dashboard. The /api path prefix is gone: a score goes to {api_endpoint}/v1/scores, and a fix read goes to {api_endpoint}/v1/fixes/active. If a proxy of yours removes the /api prefix, remove that rule. The SDK no longer sends the prefix.

In these releases the SDK found the scores host in this order: the api_endpoint option, RISICARE_API_ENDPOINT, the endpoint option, RISICARE_ENDPOINT, the default. So if you set only endpoint or RISICARE_ENDPOINT, the SDK sent scores to that host also. Python 0.5.0 and npm 0.8.0 use a new order (see above). For the hosted service, set neither — see Configuration (Python) and JS Configuration.

Other changes:

  • The fix runtime is off by default (option fix_runtime / fixRuntime, variable RISICARE_FIX_RUNTIME). Python 0.1.14 to 0.3.0 and npm 0.3.0 to 0.6.0 started it by default when an API key was set. Keep it off: during the beta the Risicare service gives no fixes to customer projects. The route that it reads was not reachable with an API key until 2026-11-06.
  • A redirect, or a 2xx response with no Risicare acknowledgement, is an export failure. Before: npm 0.6.0 counted a redirect to a page that answers 200 as a success, and Python 0.3.0 counted a 2xx response with no acknowledgement as a success.
  • When content capture is off, the SDK also removes the OpenTelemetry GenAI, OpenInference and CrewAI content keys, for example input.value, output.value and gen_ai.prompt.
  • The licence is a proprietary licence (see the LICENSE file in the package). It needs an active paid subscription. Python 0.3.0, npm 0.6.0 and earlier releases stay under the MIT licence.

To upgrade from an older release, see Upgrading from Python 0.3.0 or npm 0.6.0 or earlier.


Python SDK (risicare)

The release dates on this page are the registry upload dates (UTC).

0.1.14 — 2026-06-20

First publish to PyPI since 0.1.12 — folds in the unpublished 0.1.13 (F-704) plus framework-instrumentation truthfulness work and the run-end signal. Backward-compatible — no public symbol removed and no signature changed (top-level __all__ and all integration entry points verified identical to 0.1.12). All new behavior is additive, opt-in, or log-only.

Fixed:

  • F-A-023 — framework instrumentation now tells the truth (and works where it silently didn't). Some integrations attached wrappers that never sat on the framework's live call path (base/override shadowing, interface drift, moved patch targets) yet self-reported "instrumented" while emitting zero spans. Reworked all 10 framework integrations (langchain, autogen, langgraph, litellm, llamaindex, dspy, instructor, crewai, pydantic_ai, openai_agents) so that what is reported as instrumented actually emits spans — verified by execution on the published-install path.
  • #186 — silent span-drops are now surfaced as a rate-limited WARNING (warn-once per outage) when spans are created but no exporter is configured or the backend is unreachable. No exception is raised.
  • F-B-009 / F-B-011 — the import latch now retries after a failed instrumentation attempt, and patch functions are idempotent on retry (no double-wrapping).

Added:

  • F-B-012 — SDK run-end signal. @session, @agent, and @trace emit a lifecycle-end marker on context-manager exit (risicare.lifecycle.event=end, entity=session|agent|trace, status=ok|error). Normal exit ⇒ ok; an exception propagating out ⇒ error (the exception is re-raised unchanged). Lets the platform mark sessions ended instead of leaving them implicitly "active forever." Purely additive — an older backend ignores the marker.
  • F-704 — graceful-shutdown span flush. init() installs an os.register_at_fork hook (gunicorn --preload / celery prefork) and a SIGTERM handler so buffered spans flush on k8s / Docker / systemd termination (atexit does not fire on SIGTERM). The handler is chained (your existing handler still runs), main-thread-only, and a no-op on Windows.
  • Honest instrumentation introspection. get_instrumented_modules() now reports a richer per-module record — state ∈ attempted plus inert and version_compat keys (existing keys unchanged). Gate deploy/health checks on state == "instrumented" rather than is_instrumented(), which stays attempt-based.
  • Opt-in strict mode — set RISICARE_STRICT_INSTRUMENTATION=1 to raise InstrumentationError at boot on partial/failed instrumentation instead of proceeding best-effort. Off by default — existing behavior is unchanged unless you set it.

0.1.13 — unpublished (folded into 0.1.14)

Internal version bump for F-704 (os.register_at_fork + SIGTERM-safe flush). Never published to PyPI — its changes shipped as part of 0.1.14.

0.1.11 – 0.1.12 — maintenance releases

Incremental fixes between 0.1.10 and the 0.1.14 publish; 0.1.12 was the last release on PyPI prior to 0.1.14. See the SDK repository CHANGELOG.md for commit-level detail.

0.1.10 — 2026-03-24

Critical fix:

  • score() was blocking for up to 5 seconds per call in 0.1.9. Now uses a daemon thread with a shared persistent HTTP client — returns in under 1ms regardless of server availability.

Also includes:

  • Client-side validation: score() rejects values outside [0.0, 1.0] with a warning instead of sending to server.
  • Server-side validation: out-of-range score values now return HTTP 422 with a clear message.
  • All 13 evaluation scorers verified in production (10 pass immediately, 3 require additional configuration).

Upgrade from 0.1.9: If you installed 0.1.9, upgrade immediately to avoid blocking score() calls. Upgrade to the current release — do not pin to 0.1.10:

pip install --upgrade risicare

0.1.9 — 2026-03-22

New features:

  • risicare.score(trace_id, name, value): Record custom evaluation scores from your code. Scores appear in the dashboard linked to traces.

Documentation fixes:

  • Scorer docs rewritten — removed broken risicare_evaluation imports, replaced with risicare.score() + server-side API patterns
  • Fixed Fix Runtime import path (from risicare import init_runtime instead of from risicare.runtime import init_runtime)
  • Removed phantom from risicare import diagnose — manual diagnosis uses the REST API

0.1.8 — 2026-03-19

New features:

  • report_error(exception): report caught exceptions to the self-healing pipeline. Works both inside and outside traced contexts.
  • Client-side error deduplication: standalone report_error() calls suppress duplicate errors (same type + message) for 5 minutes
  • In-context error detection: spans worker detects errors reported via report_error() for automatic diagnosis

0.1.7 — 2026-03-07

  • Infrastructure-only release (PG least-privilege, diagnosis pipeline fixes)
  • No SDK behavior changes from 0.1.6

0.1.6 — 2026-03-03

New features:

  • @trace dual-mode: works as both decorator and context manager (with trace("name"):)
  • @session gains session_id and auto_generate parameters
  • ManagedSpan: tracer.start_span() now returns a ManagedSpan that supports both context manager and standalone .end() usage
  • Orphan trace debug warnings when @trace is not used to group LLM calls
  • service_name propagation to tracer for span metadata

Bug fixes:

  • Import hook deadlock: threading.Lock → threading.RLock across 11 framework integrations
  • Sentinel object filtering: OpenAI Omit / Anthropic NotGiven no longer corrupt span attributes and cause span drops
  • @agent and phase decorators always set context (removed early return that skipped agent_context() when tracer disabled)

0.1.4 — 2026-02-25

Security fixes (critical — upgrade required):

  • 20 security findings remediated (auth, SQL injection, OOM protection)
  • Session auth added to 27 previously unprotected dashboard routes
  • ClickHouse queries converted to parameterized placeholders (13 functions)
  • Gateway rejects spans missing project_id instead of pooling into shared bucket
  • Gateway buffer max capacity (100K) with 503 when full

Bug fixes:

  • AgentRole enum converted to string in set_attribute() (silent span loss)
  • 4 missing LLM fields added to to_dict(): temperature, max_tokens, stop_reason, confidence
  • JSON serialization errors now logged instead of silently swallowed

0.1.2 — 2026-02-23

  • Together AI v2.2+ CompletionsResource detection

0.1.3

Version 0.1.3 is published on PyPI (2026-02-25, the same day as 0.1.4). Its code is the same as 0.1.4 apart from the version string.

0.1.1 — 2026-02-23

  • project_id deprecated — emits DeprecationWarning when passed to init()
  • hash() → hashlib.md5() for deterministic A/B bucketing across restarts
  • Fix content truncated to 10K characters

0.1.0 — 2026-02-21

Initial release.

  • Auto-instrumentation via import hooks for 12 LLM providers
  • 10 framework integrations (LangChain, LangGraph, CrewAI, AutoGen, etc.)
  • Progressive integration Tiers 0–5
  • Batch span export with configurable batch_size (clamped to 1–10,000)
  • sample_rate with deterministic head-based sampling

JavaScript SDK (risicare npm)

0.4.2 — 2026-06-20

First publish to npm since 0.4.0 — folds in the unpublished 0.4.1 (PR #155 hardening + GuardRejectedError export) plus the run-end signal. Backward-compatible — no export removed; all subpath exports and decorator signatures unchanged; package exports map identical to 0.4.0.

Added:

  • F-B-012 — SDK run-end signal (parity with Python 0.1.14). agent(), session(), traceThink/Decide/Act/Observe, and the multi-agent wrappers emit a lifecycle-end marker on completion (risicare.lifecycle.event=end, entity=session|agent|trace, status=ok|error). Normal completion ⇒ ok; a thrown error ⇒ error (the error is re-thrown unchanged). New src/lifecycle.ts. Purely additive — an older backend ignores the marker.
  • GuardRejectedError is now a public root export (import { GuardRejectedError } from 'risicare') — thrown by the fix interceptor when a guard rejects an LLM call (fail-closed), and re-thrown by provider patches so the call is never made. (Originally the 0.4.1 intent.)

Fixed:

  • PR #155 — JS SDK hardening (16 audit findings closed). Input and robustness hardening across the SDK. (Originally the 0.4.1 intent; released here.)

0.4.1 — unpublished (folded into 0.4.2)

Internal bump for PR #155 (JS SDK hardening, 16 findings) + the public GuardRejectedError export. Never published to npm — released as part of 0.4.2.

0.4.0 — 2026-05-23

Webhook signature verification:

  • verifyWebhookSignature() and WebhookVerificationError are now public root exports. The verifier is synchronous, built on Node's crypto, and validates the Stripe-style t={ts},v1={hex} HMAC-SHA256 signature with a configurable timestamp-skew window and constant-time comparison — reaching parity with the Python SDK's verify_webhook_signature. Available via npm install risicare.

0.3.0 — 2026-03-28

4 critical parity fixes + stress tests:

  • Trace ID consistency (P0): getTraceContext().traceId now matches the next span's trace ID. Pre-allocates _rootTraceId in context. Fixes score() targeting wrong trace.
  • LangChain dedup (P1): RisicareCallbackHandler.withSuppression() prevents duplicate spans when used alongside patchOpenAI(). Same pattern as LlamaIndex handler.
  • reportError() dedup (P1): SHA256 fingerprint with 5-minute TTL, 1000-entry cap. 10x same error creates 1 span. Matches Python SDK.
  • Provider attribute depth (P1): All 12 providers now capture 11 gen_ai.* attributes (was 4). Includes gen_ai.request.model, gen_ai.request.temperature, gen_ai.usage.prompt_tokens, gen_ai.usage.completion_tokens, gen_ai.usage.total_tokens, gen_ai.response.finish_reasons, llm.cost.total_usd.
  • score() NaN fix: Number.isFinite() check rejects NaN and Infinity values.
  • FixRuntime subsystem: FixLoader, FixApplier, FixCache, FixInterceptor implemented (not connected to init()).
  • 58 stress tests: Wire format, lifecycle edge cases, concurrency (100 tasks), context propagation (async generators, EventEmitter), memory safety, provider edge cases. Total: 483 tests, 51 files, 0 failures.

0.2.2 — 2026-03-27

  • npm README rewritten for developer onboarding (conversion-focused with quickstart, all 12 providers, 4 frameworks)
  • package.json metadata updated (description, keywords, homepage, bugs URL)

0.2.1 — 2026-03-25

Bug fix:

  • Phase decorators (traceThink, traceDecide, traceAct, traceObserve) now accept an optional name parameter: traceThink("analyze", fn) in addition to the bare form traceThink(fn).

0.2.0 — 2026-03-24

Major release — full provider and framework parity with Python SDK.

Providers (3 → 12):

  • Added 9 native providers: Google Gemini (patchGoogleAI), Mistral (patchMistral), Groq (patchGroq), Cohere (patchCohere), Together AI (patchTogether), Ollama (patchOllama), HuggingFace (patchHuggingFace), Cerebras (patchCerebras), AWS Bedrock (patchBedrock)
  • 8 OpenAI-compatible hosts detected by base URL via patchOpenAI(): DeepSeek, Together AI, Groq, xAI, Fireworks, Baseten, Novita, BytePlus (any other compatible endpoint, e.g. self-hosted vLLM, is traced generically)

Frameworks (0 → 4):

  • LangChain.js: RisicareCallbackHandler from risicare/langchain
  • LangGraph.js: instrumentLangGraph() from risicare/langgraph
  • Instructor: patchInstructor() from risicare/instructor
  • LlamaIndex.TS: RisicareLlamaIndexHandler from risicare/llamaindex

Other:

  • tracedStream() utility for tracing async iterables
  • Dedup infrastructure (suppressProviderInstrumentation)
  • AgentRole expanded to 14 values, MessageType to 18 values
  • 404 tests passing

0.1.5 — 2026-03-24

Bug fixes:

  • Fixed context propagation — withSession(), withAgent(), and withPhase() now work without requiring init(). Previously, context was silently skipped when the SDK wasn't initialized, causing unreliable session/agent tracking.

New features:

  • reportError(error, options?) — report caught exceptions for diagnosis. Creates an error span that triggers the self-healing pipeline. Never throws.
  • score(traceId, name, value, options?) — send custom evaluation scores. Validates range [0.0, 1.0], non-blocking. Never throws.

0.1.4 — 2026-03-07

  • project_id deprecated — emits console.warn when passed to init()
  • Version bump to align with Python SDK audit fixes

0.1.2 — 2026-02-22

  • Agent role, parent agent ID, session user ID propagated as span attributes (Python parity)
  • extractTraceContext keys normalized to camelCase
  • getCurrentContext() expanded with all stored fields
  • Phase decorators use correct SpanKind (THINK/DECIDE/TOOL_CALL/OBSERVE) instead of INTERNAL
  • REFLECT, COMMUNICATE, COORDINATE added to SemanticPhase enum

0.1.1 — 2026-02-21

Critical fixes:

  • Provider bundle isolation: singletons moved to globalThis so sub-path exports share tracer state
  • traceContent config wired through to Tracer
  • Process listener leak fixed (.once() + cleanup on shutdown)
  • Failed export batches re-queued with 3-retry limit before drop
  • Shutdown race condition: Promise-based dedup replaces boolean flag
  • Circuit breaker: half-open state sends 1 probe, not full retry loop
  • Anthropic/Vercel AI SpanKind: CLIENT → LLM_CALL
  • getMetrics() exposed in public API

0.1.0 — 2026-02-21

Initial release.

  • OpenAI, Anthropic, Vercel AI SDK provider instrumentations
  • AsyncLocalStorage-based context propagation
  • agent(), session(), phase decorators as higher-order functions
  • BatchSpanProcessor with HTTP exporter

Migration Guides

Upgrading from Python 0.6.x or npm 0.9.x

  1. Install the current release: pip install --upgrade risicare or npm install risicare@latest. A pin such as risicare~=0.6.0 or "risicare": "^0.9.0" does not take it.
  2. Content capture is on by default since Python 0.7.0 and npm 0.10.0. If prompt and completion text must not leave your process, set trace_content=False (npm: traceContent: false) or RISICARE_TRACE_CONTENT=false. See Python 0.7.0 and npm 0.10.0.
  3. With capture on, the OpenAI and Anthropic patches send the whole request since Python 0.11.0 and npm 0.14.0: the tool definitions, the system prompt and the message list. See Python 0.11.0 and npm 0.14.0.
  4. score() sends a number outside 0 to 1, and sends True and False as booleans, since Python 0.8.0 and npm 0.11.0. If a reader of your scores expects 0 to 1, check your values.
  5. The SDK keeps a batch through a gateway outage for up to 300 seconds, and shutdown() waits up to 10 seconds, since Python 0.8.0 and npm 0.11.0. If your process must stop sooner, set shutdown_timeout_s (npm: shutdownTimeoutS). See Python 0.8.0 and npm 0.11.0.
  6. TypeScript: an interface that extends ScoreOptions does not compile with npm 0.14.0. Extend ScoreValueOptions, or use a type alias.

Upgrading from Python 0.3.0 or npm 0.6.0 or earlier

What an older release does today:

  • It sends spans to https://app.risicare.ai/v1/spans. The gateway accepts spans at that address through a temporary route. Risicare will remove this route. It has not announced a date.
  • npm 0.6.0 follows a redirect. If that address redirects to a page that answers 200, npm 0.6.0 counts it as a success, and the spans are lost with no warning. Python 0.3.0 does not follow a redirect, and it reports the failure. Other older releases were not checked for this.
  • A release that has score() sends scores to https://app.risicare.ai/api/v1/scores. That address answers 401 to an API key, so the scores are not recorded.
  • Python 0.1.14 to 0.3.0 and npm 0.3.0 to 0.6.0 start the fix runtime by default when an API key is set. It reads fixes from https://app.risicare.ai/api/v1/fixes/active, which also answers 401.

To upgrade:

  1. Install the current release: pip install --upgrade risicare or npm install risicare@latest.
  2. Remove an endpoint option or a RISICARE_ENDPOINT value that names https://app.risicare.ai. (In 0.4.0 and 0.7.0, https://ingest.risicare.ai as the endpoint sent scores to the ingest gateway, which has no scores route; 0.5.0 and 0.8.0, and the releases after them, send them to the API host.) With no value, the SDK uses the two default hosts.
  3. Do not start the fix runtime during the beta. The new releases do not start it by default, and during the beta the service gives no fixes to customer projects.

Upgrading from 0.1.2 or earlier to 0.1.4+

project_id deprecated:

# Before (0.1.2)
risicare.init(  # the key comes from RISICARE_API_KEY
    project_id="my-project",  # ⚠️ DeprecationWarning
)
 
# After (0.1.4+)
risicare.init(  # the key comes from RISICARE_API_KEY
    service_name="my-agent",
    environment="production",
)

The gateway determines your project from the API key. Use service_name and environment for organization within a project.

Upgrading from 0.1.4 to 0.1.6+

No breaking changes. New features are additive:

# New: @trace as context manager
from risicare import trace
 
with trace("my-operation"):
    result = do_work()
 
# New: @session with fixed ID
from risicare import session
 
@session(session_id="fixed-id")
def handle(query):
    pass
 
# New: @session with auto-generated ID
@session(auto_generate=True)
def handle(query):
    pass

Version Compatibility

Python SDKCorePythonNote
0.16.0≥0.1.8≥3.10Current — published on PyPI
0.15.0≥0.1.8≥3.10Published on PyPI
0.14.0≥0.1.8≥3.10Published on PyPI
0.13.1≥0.1.8≥3.10Published on PyPI
0.13.0≥0.1.8≥3.10Published on PyPI
0.12.0≥0.1.8≥3.10Published on PyPI
0.11.0≥0.1.8≥3.10Published on PyPI
0.10.0——Not uploaded to PyPI (its changes are in 0.11.0)
0.9.0——Not uploaded to PyPI (its changes are in 0.11.0)
0.8.0≥0.1.8≥3.10Published on PyPI
0.7.0≥0.1.8≥3.10Published on PyPI
0.6.3≥0.1.8≥3.10Published on PyPI
0.6.2≥0.1.8≥3.10Published on PyPI
0.6.1≥0.1.8≥3.10Published on PyPI
0.6.0≥0.1.8≥3.10Published on PyPI
0.5.1≥0.1.8≥3.10Published on PyPI
0.5.0≥0.1.8≥3.10Published on PyPI
0.4.0≥0.1.7≥3.10Published on PyPI
0.3.0≥0.1.7≥3.10Published on PyPI
0.2.2≥0.1.6≥3.10Published on PyPI
0.2.0≥0.1.6≥3.10Published on PyPI
0.1.14≥0.1.0≥3.10First publish of the fork/SIGTERM flush fix
0.1.13——Unpublished (folded into 0.1.14)
0.1.12≥0.1.0≥3.10Last PyPI release before 0.1.14
0.1.11≥0.1.0≥3.10
0.1.10≥0.1.0≥3.10
0.1.9≥0.1.0≥3.10Do not use (blocking score())
0.1.8≥0.1.0≥3.10
0.1.7≥0.1.0≥3.10
0.1.6≥0.1.0≥3.10
0.1.5≥0.1.0≥3.10
0.1.4≥0.1.0≥3.10Minimum recommended
0.1.3≥0.1.0≥3.10Same code as 0.1.4
≤0.1.2——Do not use

The Core column is the risicare-core requirement that each release declares on PyPI.

JS SDKNode.jsNote
0.19.0≥18.0.0Current — published on npm
0.18.0≥18.0.0Published on npm
0.17.0≥18.0.0Published on npm
0.16.1≥18.0.0Published on npm
0.16.0≥18.0.0Published on npm
0.15.0≥18.0.0Published on npm
0.14.0≥18.0.0Published on npm
0.13.0—Not uploaded to npm (its changes are in 0.14.0)
0.12.0—Not uploaded to npm (its changes are in 0.14.0)
0.11.0≥18.0.0Published on npm
0.10.0≥18.0.0Published on npm
0.9.2≥18.0.0Published on npm
0.9.1≥18.0.0Published on npm
0.9.0≥18.0.0Published on npm
0.8.0≥18.0.0Published on npm
0.7.0≥18.0.0Published on npm
0.6.0≥18.0.0Published on npm
0.5.2≥18.0.0Published on npm
0.5.0≥18.0.0Published on npm
0.4.2≥18.0.0Run-end signal + GuardRejectedError
0.4.1≥18.0.0Unpublished (folded into 0.4.2)
0.4.0≥18.0.0Webhook signature verifier
0.3.0≥18.0.04 critical parity fixes + stress tests
0.2.2≥18.0.0README + metadata
0.2.1≥18.0.0Phase decorator name fix
0.2.0≥18.0.0Full provider + framework parity
0.1.5≥18.0.0reportError + score
0.1.4≥18.0.0
0.1.3≥18.0.0
0.1.2≥18.0.0
0.1.1≥18.0.0
0.1.0≥18.0.0

Next Steps