Skip to content
Tool

agentshield

Runtime guard that blocks AI coding agents from reading secrets or running destructive

Pricing
Open source
Platforms
CLI, Linux, macOS
Listing updated
today

Similar tools

About agentshield

agentshield is an open-source AI tool for developer tools. It is available on CLI, Linux, macOS, Windows, API, self-hosted and vscode.

The README says AgentShield sits between an autonomous coding agent and the machine it runs on. It inspects shell commands before they run and scrubs stdout and stderr so credentials such as .env values, SSH keys and API tokens are replaced with surrogate tokens before they reach a model's context or git history.

The project ships as a Node.js package with no runtime dependencies. It includes a command firewall that targets obfuscated credential reads, a streaming redactor that handles secrets split across chunks, a pre-commit hook and a GitHub Action for scanning code, and generators for Claude Code and Cursor hook configuration. SDKs for Python, Go and Rust are also described, along with a JSON-RPC stdio sidecar for other languages.

The README is explicit that the userland command inspection is defense-in-depth and not an OS kernel security boundary. It describes macOS Seatbelt as kernel-enforced, while Linux and Windows profiles are described as defense-in-depth unless run inside a container. It is aimed at developers who run coding agents such as Claude Code, Cursor or Windsurf on their own machines or in CI.

What it does

Shell command firewall
Inspects agent-issued commands and blocks attempts to read credential files or dump environment variables.
Streaming output redaction
Replaces detected secrets in stdout and stderr with deterministic surrogate tokens, including across chunk boundaries.
Pre-commit secret gate
Audits staged diffs through a native git hook or the pre-commit framework to keep credentials out of history.
CI security check
Provides a GitHub Action and CLI command that fail builds when credentials appear in a branch diff.
Agent hook generators
Creates Claude Code PreToolUse configuration and Cursor rules files with one command.
OS sandbox diagnostics
Checks whether Seatbelt, bwrap, Landlock or AppContainer isolation is available and can refuse to run without it.

Good for

  • Stop a coding agent from printing .env files or environment variables into its prompt
  • Block commits that contain API keys or private keys before they reach git history
  • Add a secret scan step to pull request pipelines
  • Redact credentials from prompts sent to LLM APIs in custom agent code

Pricing

Open source

Free and Apache-2.0 licensed; sponsorship is optional.

agentshield FAQ

Is AgentShield a full OS security sandbox?

No. The README says userland command inspection is defense-in-depth and not an OS kernel boundary. It describes macOS Seatbelt as kernel-enforced, while Linux and Windows isolation depends on container use.

Does it need any runtime dependencies?

The README states it has zero runtime dependencies and is pure Node.js for the TypeScript package.

Which languages have SDKs?

The README lists TypeScript, Python, Go and Rust SDKs, and a language-agnostic stdio sidecar for other languages.

What license does it use?

The README says it is Apache-2.0 licensed.

Is agentshield free?

Yes. agentshield is open source, so you can use and self-host it for free.

What are the best alternatives to agentshield?

The closest alternatives to agentshield are claude-bulkhead, agent-governance-toolkit, ECC, agents and Aiproxy.

Where this comes from

  • Description: written from the project's README.