Redaction
Mask keys, tokens and passwords before anything reaches the model, use a key through a placeholder, and scan changes for secrets.
Mask secrets
Enable Preferences → Permissions & sandbox → Mask secrets. KodaCode then masks keys, tokens and passwords before it sends anything to the model provider. Masking fails closed. Text that it can't finish checking is replaced with a marker, never sent as it was.
Use a key without the model seeing it
With masking on, use the shield button in the prompt box, Paste as secret. It puts the value on your clipboard into your message as a «secret:N» placeholder. The model sees only the placeholder. When a command that the agent runs uses the placeholder, KodaCode puts the real value in its place on your machine. KodaCode stores the value encrypted, with one key in your system keychain.
❯ Deploy to staging with «secret:1» as the token.
$ curl -H "Authorization: Bearer «secret:1»" https://staging.example.com/deploy
Secrets in MCP servers and providers
API keys, provider sign-ins and MCP values marked $secret are kept in the OS keychain, never in config.toml.
Secret scanning
When a turn changes files, Betterleaks scans them. The Scan of this turn's changes card names the file and line while it's still easy to fix. /review runs the same scanner, and the built-in secret-leak-check automation catches a key added in the latest commit.
Crew workers
Crew workers follow the same redaction as every agent. They can read .env* files. With redaction on, KodaCode masks the secret values in what they read.