<!-- https://zerolog.ch/docs/redaction · Docs / Keys and privacy -->
# Blackout of secrets

> Secrets are blacked out before anything is stored or sent on.

**Secrets are blacked out before anything is stored or sent on.** Tool output, the agent log and requests to a model provider pass one blackout step.

- In tool output, three asterisks replace passwords inside addresses, proxy variables, values of names ending in secret or token, and unambiguous key formats. This runs in chat turns and in background job runs, before the output goes into the chat history or to the provider.
- Before a request goes to a model provider, the values of your [vault](https://zerolog.ch/docs/vault) entries are replaced as well, also as base64, hex or URL encoded text, by the placeholder or a short note.
- The command of an Ultracode agent shows in the log up to 2,000 characters, with the same patterns and your vault values blacked out.
- The [key service](https://zerolog.ch/docs/keyproxy) removes your key values from provider responses and swaps new secrets for placeholders.

## Where this stops

The patterns recognize formats and names. A secret in a format nobody could recognize, in a place the patterns do not cover, can still pass. Vault values are replaced only if you saved them. After a database login the data stream is not scanned for the value. For values you do not want the AI to read at all, set the entry to **use only** or **locked**.

## Where secrets are blacked out

Mermaid source of the diagram on this page:

```mermaid
%% Blackout of secrets: where values are replaced. Facts from server/ausgabe-schwaerzen.js, keyservice/src/schwaerzen.js, agent_log.
flowchart TB
  out["Tool output<br/>env, logs, command results"]
  req["Request to a model provider<br/>after the chat is assembled"]
  log["Agent log<br/>command up to 2000 characters"]
  red["Blackout step<br/>replaces secrets before<br/>anything is stored or sent"]:::hot
  db["Chat history and database"]
  prov["Model provider"]

  out --> red
  req --> red
  log --> red
  red --> db
  red --> prov

  linkStyle 3 stroke:#8f7ac9
  linkStyle 4 stroke:#8f7ac9

  classDef hot stroke:#8f7ac9
```
