Privacy

What the SDK transmits, what it never transmits, and the canary test that enforces it.

Prompts and completions are never transmitted. This page lists exactly what is.

Transmitted

Per call:

  • model and provider
  • token counts: input, output, cache read, cache write
  • computed cost
  • latency
  • attribution: agent, team, task type, session, customer, cost centre
  • environment label
  • the file and line that made the call
  • whether the call was routed, and from which model
  • whether it failed, and the exception's type name

Never transmitted

  • prompt text, system prompts, message content
  • completion text
  • tool definitions, tool arguments, tool results
  • embedding inputs and output vectors
  • exception messages, because provider errors often quote the prompt back
  • your provider API keys, which the SDK does not read

Prompt analysis records structure only

Optional prompt analysis (enable_prompt_analysis=True, off by default) adds structural metrics:

RecordedNot recorded
estimated prompt tokensthe prompt
message count, conversation turnsthe messages
a hash of the system promptthe system prompt
whether few-shot examples are present, and how manythe examples
tool-result token totalsthe tool results
context-window utilisationanything that could reconstruct it

The system-prompt hash lets the backend detect that many calls shared one system prompt, which is how an uncached repeated preamble becomes visible. It is a one-way digest and cannot reproduce the prompt.

Two fields describe your code

caller_file is a path and line number from your repository, such as app/agents/planner.py:44. This is what makes spend traceable to code, and it does describe your project layout.

Agent names are stored as you write them. @capsera.agent("acme-onboarding-flow") is recorded verbatim. Attribution values are the only place your own strings are stored, so avoid names that are themselves sensitive. customer_id is intended for an opaque identifier rather than a customer name.

The canary test

This guarantee is enforced by a test. The evaluation harness plants unique canary strings inside prompts, runs the full corpus, and scans every emitted payload for them. A single occurrence fails the run, alongside phantom events, duplicate billing, and false budget blocks.

A future change that started capturing message content would fail that gate rather than merging quietly.

Self-hosting

Events go to the endpoint you configure. Pointing it at your own deployment keeps everything above inside your infrastructure:

capsera.init(
    api_key=os.environ["CAPSERA_API_KEY"],
    endpoint="https://capsera.internal.example.com",
)

The SDK has one destination, the one you set. There is no secondary telemetry channel and no usage analytics of its own.