Secrets are kept away from the model, transcripts and model-written commands by default. There are three layers.
- Masking known values. At startup Chanto collects real secret values from three places: secret-named environment variables (
*_TOKEN,*SECRET*,*PASSWORD*,*API_KEY*and similar, plus a random-looking value in any other*_KEY;*PUBLIC_KEYand names likeCACHE_KEYandSORT_KEYdon't count), its own API keys, and the project's.env,.env.*and.dev.varsfiles. Example files like.env.exampleare skipped, and changed files are re-read each turn. Sign-in tokens Chanto gets while running (chanto loginOAuth tokens, MCP servers' OAuth tokens) are added as they're used, and a background run also masks the values in its source checkout's env files, which its worktree doesn't have. Those exact values, plus their base64 and URL-encoded forms, are replaced with[REDACTED:NAME]in everything sent to the model (every request: turns, compaction summaries, hook and classifier checks and other side calls) and in saved sessions. That covers tool output, file contents, your own messages and tool-call arguments. What leaves the session is masked too:--output-format stream-jsonevents, the web UI and/remote(events, permission prompts and questions, transcripts, checkpoints and the message queue), background runs' event logs, and what a runner sends its server (including a run's script output). Streamed answer text is masked one piece at a time, so a known value the model writes split across two pieces could show; the model only ever sees masked values, so it can't repeat one it wasn't shown. If you paste a secret into a message, Chanto warns you that it was masked. - Masking known formats. Common token formats are masked even when Chanto doesn't know the value:
- AWS, GitHub, GitLab, Slack, Stripe, OpenAI, Anthropic, Google, npm, PyPI, Hugging Face, SendGrid and DigitalOcean tokens;
- private keys and JWTs;
- passwords in URLs and bearer tokens;
- random-looking values assigned to secret-named keys.
- Prevention:
- Secret files need your approval. Reading or editing
.envfiles, keys and certificates (*.pem,*.key,id_rsa),~/.ssh,~/.aws,~/.netrc,~/.docker/config.json,~/.kube/configand similar asks first in every mode except bypass, and so does a shell command that mentions one. - Secret variables are withheld from commands. Secret-named environment variables aren't passed to shell commands the model runs (any
*_KEYcounts here, whatever its value; list one inpass_envif a tool needs it). On Linux, Chanto also marks its own process non-dumpable, so a command can't read them back from/proc/<chanto's pid>/environor attach to Chanto. This also means Chanto leaves no core dump, andgdb -p,strace -pand similar tools can't attach to a running Chanto without root.
- Secret files need your approval. Reading or editing
toml
[secrets]
redact = true # layers 1 and 2
protect_files = true # ask before secret files are read or changed
scrub_env = true # withhold secret-named variables from shell commands
pass_env = ["GH_TOKEN", "AWS_*"] # ...except these (names or prefix*), if your tools need themTo let the agent read one specific file without asking, add an allow rule such as Read(./.env.test). Project config can't weaken these settings unless you trust the project.