Sanitize AI agent trajectories for traced.run
Project description
Trace-Sanitizer
Sanitize your AI agent trajectories and publish misaligned or funny trajectories on traced.run.
Supports Claude Code, Codex, Gemini CLI, and OpenCode.
Install
pip install trace-sanitizer
1. Single trajectory
Export one trajectory interactively — no configuration needed.
trace-sanitizer export
This auto-detects all sources, lets you pick a project and session, asks about tool output inclusion, and exports a sanitized JSONL file. Review it for PII, then publish it on traced.run.
Agent prompt
Paste this into Claude Code or any coding agent:
Help me export a conversation using trace-sanitizer.
1. pip install trace-sanitizer
2. trace-sanitizer update-skill claude
3. trace-sanitizer export
(Interactive menu — pick a project and session.)
4. Review the exported JSONL for PII.
5. Tell the user how to publish it at https://traced.run
2. BETA: Donate multiple trajectories
This is beta.
Real world coding trajectories are important for early detection of AI misalignment, failures, and scheming in the wild. Your trajectories might contain relevant examples that can make a real difference for research. Trace-sanitizer is maintained by Dr. Joachim Schaeffer. I am currently a MATS 9.0 Fellow. I am talking to AI safety research institutes about formal data contribution pipelines. A more structured process will follow.
But if you want to get active now already, bulk donation works like this:
# Export all trajectories (auto-detects sources, includes tool outputs)
trace-sanitizer export --all
# Review the export for PII
trace-sanitizer confirm \
--full-name "YOUR NAME" \
--attest-full-name "Scanned for full name." \
--attest-sensitive "Checked for company names and private URLs." \
--attest-manual-scan "Sampled 20 sessions manually."
This creates a traced_export/ folder containing trajectories.jsonl and a LICENSE-CDLA-Permissive-2.0.md. Zip the folder and email the link to donate@traced.run.
You can customize the export with additional flags:
trace-sanitizer export --all --source claude # only Claude Code
trace-sanitizer export --all --no-tool-outputs # exclude tool outputs
trace-sanitizer export --all -o my_export.jsonl # custom output path
trace-sanitizer config --exclude "secret-project" # exclude specific projects
trace-sanitizer config --redact "CompanyName" # redact custom strings
All commands
| Command | Description |
|---|---|
trace-sanitizer export |
Interactive: pick a project and session |
trace-sanitizer export --all |
Export all sessions to traced_export/ folder |
trace-sanitizer export --source claude |
Filter by source |
trace-sanitizer export --include-tool-outputs |
Include tool results |
trace-sanitizer export --no-thinking |
Exclude extended thinking |
trace-sanitizer prep |
Discover projects (JSON) |
trace-sanitizer list |
List projects with exclusion status |
trace-sanitizer config --source all |
Set source scope |
trace-sanitizer config --exclude "a,b" |
Exclude projects |
trace-sanitizer config --redact "str" |
Add custom redaction strings |
trace-sanitizer config --redact-usernames "u" |
Anonymize usernames |
trace-sanitizer config --confirm-projects |
Confirm project selection |
trace-sanitizer confirm ... |
PII scan + review attestations |
trace-sanitizer status |
Show current stage (JSON) |
trace-sanitizer update-skill claude |
Install skill for Claude Code |
What gets redacted
- Paths — stripped to project-relative
- Usernames — macOS username + configured handles replaced with hashes
- Secrets — JWT tokens, API keys (Anthropic, OpenAI, HF, GitHub, AWS, etc.), private keys, webhooks
- Entropy — high-entropy strings flagged as potential secrets
- Emails — personal addresses removed
- Custom — your configured strings and usernames
Not foolproof. Always review before sharing.
Data schema
Each JSONL line is one session:
{
"session_id": "abc-123",
"project": "my-project",
"model": "claude-opus-4-6",
"start_time": "2025-06-15T10:00:00+00:00",
"messages": [
{"role": "user", "content": "Fix the login bug"},
{"role": "assistant", "content": "I'll investigate...", "tool_uses": [{"tool": "Read", "input": "src/auth.py"}]}
],
"stats": {"user_messages": 5, "assistant_messages": 8, "tool_uses": 20}
}
License
MIT — forked from dataclaw by Banodoco.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file trace_sanitizer-0.1.0.tar.gz.
File metadata
- Download URL: trace_sanitizer-0.1.0.tar.gz
- Upload date:
- Size: 62.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f12512b62e96e5bb8b1e76fc993bc0046accd2213c0d1a474c070f36c4da532b
|
|
| MD5 |
02afea6999195a9440cd4de3ce0b00ba
|
|
| BLAKE2b-256 |
72d94341719e70982d6d6defaeae54b0bceef13051b05cc655c156613af786a1
|
Provenance
The following attestation bundles were made for trace_sanitizer-0.1.0.tar.gz:
Publisher:
publish.yml on JoachimSchaeffer/trace-sanitizer
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
trace_sanitizer-0.1.0.tar.gz -
Subject digest:
f12512b62e96e5bb8b1e76fc993bc0046accd2213c0d1a474c070f36c4da532b - Sigstore transparency entry: 1060234397
- Sigstore integration time:
-
Permalink:
JoachimSchaeffer/trace-sanitizer@a3c94c85393e4878066c818fdda9ff7df803a20f -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/JoachimSchaeffer
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@a3c94c85393e4878066c818fdda9ff7df803a20f -
Trigger Event:
push
-
Statement type:
File details
Details for the file trace_sanitizer-0.1.0-py3-none-any.whl.
File metadata
- Download URL: trace_sanitizer-0.1.0-py3-none-any.whl
- Upload date:
- Size: 45.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1f8ce7ee63d3867f47b592776187907c11c42322e1c7e7e9cf1e22a07ac48a79
|
|
| MD5 |
668f4f68813cb84672e8c030870fc93a
|
|
| BLAKE2b-256 |
9cad04f7cbd9acd1779649d6131dfb18e2404171759047d44c7dc23e6891c945
|
Provenance
The following attestation bundles were made for trace_sanitizer-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on JoachimSchaeffer/trace-sanitizer
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
trace_sanitizer-0.1.0-py3-none-any.whl -
Subject digest:
1f8ce7ee63d3867f47b592776187907c11c42322e1c7e7e9cf1e22a07ac48a79 - Sigstore transparency entry: 1060234401
- Sigstore integration time:
-
Permalink:
JoachimSchaeffer/trace-sanitizer@a3c94c85393e4878066c818fdda9ff7df803a20f -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/JoachimSchaeffer
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@a3c94c85393e4878066c818fdda9ff7df803a20f -
Trigger Event:
push
-
Statement type: