Docs · agent-lookback
agent-lookback
A free, open-source command that reads the session logs your coding agents already keep and tells you which secrets they have seen, which sensitive files they opened and what is set up for them. It runs on your machine and sends nothing anywhere.
Run it
You need Node.js 20.3 or newer. There is nothing to install and no account to create.
npx agent-lookbackIt takes a few seconds and prints a short report: four numbers, the findings that matter most and what to do about them. The source is on GitHub under the MIT license, and the package is on npm.
What the report shows
When an agent reads a file or prints it with a command, the contents become part of the conversation. They are sent to the model provider and stay in plain text in a log in your home directory. The report answers four questions about those logs.
- Which secrets an agent has seen. API keys, tokens, private keys and secret environment values that appeared in tool output, in commands, in files the agent wrote or in text you pasted.
- Which sensitive files were opened.
.envfiles, SSH keys, cloud credentials, shell history and similar. - Whether a secret travelled. Network commands such as
curl,scpandsshthat contained a secret or were handed a sensitive file, with the hosts they named. - What is set up for your agents. MCP servers, hooks and other commands that run on their own, plugins, editor extensions and permission settings across about 20 coding agents, with the risky ones marked.
Options
--detailslists every finding with where it came from, and the setup of every tool.--shareprints a card with counts only, with no paths, names or hosts, so it is safe to post.--jsonprints the full report for scripts.--days 7looks at the last seven days only.--fail-on highexits with code 1 when a high-severity secret or setup finding is present.
What it does with your data
- It opens no network connection and has no telemetry. A test in the repository fails the build if a network or process API is ever used.
- Secret values are never printed or stored. Each one is shown as a type, such as “GitHub token”, and a random id that is new in every run.
- Command lines are never shown. From a command the report shows only well-known program names, files of a sensitive class and host names; arguments, flags and quoted text are left out.
- It reads the session logs and the agent configuration files. It does not read the sensitive files themselves: a file appears in the report because a log shows an agent opening it.
Limits
- Session history is read for Claude Code and Codex. Other agents appear in the setup list only.
- Only logs that are still on disk are covered. Claude Code removes transcripts after 30 days by default.
- Only what the logs record is covered. A child process or an MCP server acting on its own leaves no trace in a transcript.
- A realistic sample looks like a live key. Values seen only in test or example files, test-mode keys and expired tokens are not counted; check where each of the others came from before rotating.
- It is built and tested on macOS. Linux and Windows are untested.
After the report
Rotate what was exposed first: a secret that reached a model provider is not unsent by deleting a log. agent-lookback looks back at one machine. To find secrets and unsafe agent settings committed to a repository, run a free vetkit Security Quick Scan.