> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ancha.io/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> These docs describe the Ancha CLI, npm package @ancha-labs/cli, and the hosted workspace at app.ancha.io. Coding agents should start at https://docs.ancha.io/coding-agents. Run the CLI as `ancha` after `npm install -g @ancha-labs/cli`, or as `npx -y @ancha-labs/cli` without installing. Pass --json for machine-readable output, or set ANCHA_JSON=1. Every command ends with a `next:` line naming the next command. Exit codes: 0 pass, 1 a check failed or a comparison regressed, 2 usage, config or authentication error, 3 infrastructure error, 4 unimplemented endpoint with --strict.

# Trace privacy

> What Ancha keeps from your production traces, what it removes or replaces before storing them, how long it keeps them, and how to download or delete them.

Production traces carry your customers' data. Ancha stores as little of it as rebuilding needs, removes credentials, and replaces contact details before anything is written to storage.

## What Ancha keeps

| Kept | Not kept |
| - | - |
| Each API call your agent made: method, URL, status, and request and response bodies | Headers: OTLP spans do not carry them, and an uploaded file loses its credential headers |
| Each webhook your agent received, with its body | Raw spans: they are redacted when they arrive, and deleted once the trace is assembled, or when it cannot be |
| Each model call: the model, token counts, and the user and assistant messages it was sent | System instructions, even when your instrumentation sends them as a message, and model replies |
| Tool calls: name, arguments and result | |

## What is removed or replaced before storage

| Data | What happens |
| - | - |
| Fields named like credentials: `authorization`, `cookie`, `x-api-key`, `api_key`, `password`, `secret`, `client_secret`, `private_key`, `access_token`, `refresh_token`, and webhook signature headers, also inside tool arguments and results sent as JSON strings | Removed with their value. |
| Values shaped like secrets: Slack, GitHub, Stripe and model provider tokens, AWS access keys, bearer tokens, Ancha keys | Replaced with `[redacted]`. |
| Email addresses | Replaced with a stand-in such as `person-3f2a9c1e04@example.com`. The same address gets the same stand-in everywhere in your workspace, so one person stays one person across tools. |
| Phone numbers | Replaced the same way, with a `+1555` number. |
| Base64 file contents, such as files read from GitHub | Decoded and checked the same way. |

This happens before anything is stored, also for spans waiting to be assembled into a trace. The trace page lists how many of each were removed or replaced.

Names, addresses and other personal details written in free text are not detected. If your agent handles them, remove them before export, for example in an OpenTelemetry span processor.

## Retention and deletion

* Traces are kept for 30 days, then deleted with their stored data. The trace page shows the date. Spans that never became a trace are deleted after the same 30 days.
* Tests you save keep the starting data rebuilt from their trace until you delete them.
* **Delete trace** removes the trace, its stored data and any spans still arriving. Check **Also delete the tests saved from it** to remove those too. The API does the same with `DELETE /v1/traces/<id>`, and `?tests=1`.
* **Download what Ancha stored** gives you exactly what is kept for a trace.

## Who can reach it

* Ingest keys can only add traces to your workspace. They cannot read anything.
* Deleting traces needs a signed-in session or an admin API key. See [Login and API keys](https://docs.ancha.io/cloud/login-and-api-keys.md).
* Traces and tests are readable only from your account, in the console or with your API keys.


## Related topics

- [Trace IR](https://docs.ancha.io/reference/trace-ir.md)
- [From a production trace to a failing test](https://docs.ancha.io/guides/rebuild-from-traces.md)
- [ancha import](https://docs.ancha.io/cli/import.md)
- [Changelog](https://docs.ancha.io/changelog.md)
- [Traces](https://docs.ancha.io/cloud/traces.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.