Answers

How do I keep AI agent verification codes out of logs?

Treat verification codes and magic links as credentials. Pass them only to the step that needs them, and strip them from logs and transcripts.

The same goes for authenticator secrets. The MCP authorization tutorial recommends removing tokens, authorization codes and secrets from logs.

Check a workflow without exposing a real code

  1. Use a made-up test message containing a placeholder such as 123456, not a real sign-in code.
  2. Trace every place the message can go: application logs, browser recordings, tool results, error reports and model transcripts.
  3. Replace code and link values with a marker before anything is saved. Check error paths too: a failed request may otherwise print the whole response.
  4. Log useful facts instead: that a message arrived, the service name, the time, and whether verification succeeded. Avoid recording a link's query string.
  5. Search the test logs for the placeholder and look at every match. If a real credential was exposed, rotate or revoke it; deleting a log does not undo copies elsewhere.

Filtering text is one layer, not a guarantee. Keep inbox and credential access narrow, and give a workflow only what it needs for its task.

ActAs gives each agent its own connection, limited to the inboxes and logins you choose, so a code can only reach the agent that needs it.