Skip to content

About

Checks Claude Code, Codex, and Pi tool calls on macOS before they run. Blocks broad filesystem scans and recognizable credential reads, and tells the agent what to run instead.

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

Agent Guard

Agent Guard checks Claude Code, Codex and Pi tool calls on macOS before they run. It blocks home-directory scans and credential reads, then tells the agent what to do instead.

A scan from ~ enters other apps' data under ~/Library. macOS records this as App Data access. This can trigger repeated permission prompts. Broad reads can pull .env files, private keys or the whole environment into the agent's context.

Keep searches inside the project

The guard blocks scans rooted at ~ or ~/Library before the tool runs:

$ rg -n TODO ~
[policy:agent-guard/broad_scan] DENIED: A scan rooted at the home directory or ~/Library reaches every app-data entry. Scope the scan to a project path.

Project-scoped searches such as rg -n TODO src pass without output.

Use credentials without printing them

The guard blocks credential reads, environment dumps and recursive searches that can reach hidden credential files. Clients can still use credential files through modelled options such as ssh -i. The guard does not control what the client does with the file's contents.

Fail closed

A check that errors or times out blocks the tool call. A passing check leaves the runtime's permission rules in force.

Get started

Requires Apple Silicon macOS and Homebrew. Install Agent Guard and register its hook for Claude Code, Codex or Pi.

Limits

The guard is a text preflight check, not a sandbox. It only sees calls that reach a registered hook. Use operating system read restrictions for reads a script chooses at runtime.

Contributing

Contributors build, test and release the Rust implementation from a source checkout.

License

Agent Guard is available under the MIT license.

About

Checks Claude Code, Codex, and Pi tool calls on macOS before they run. Blocks broad filesystem scans and recognizable credential reads, and tells the agent what to run instead.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages