# agentshield

> agentshield is an open-source AI tool for developer tools. Runtime guard that blocks AI coding agents from reading secrets or running destructive. It is available on CLI, Linux, macOS, Windows, API, self-hosted and vscode.

- **Kind:** Tool
- **Pricing:** Open source
- **Platforms:** CLI, Linux, macOS, Windows, API, self-hosted, vscode
- **Repository:** https://github.com/ritualdev-lab/agentshield
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-11-18

## About

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.

## Features

- **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

## 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.

## Alternatives

- [claude-bulkhead](https://ai-powered.com/tools/claude-bulkhead): claude-bulkhead is an open-source AI tool for developer tools.
- [agent-governance-toolkit](https://ai-powered.com/tools/agent-governance-toolkit): agent-governance-toolkit is an open-source AI tool for security.
- [ECC](https://ai-powered.com/tools/ecc): ECC is a freemium AI tool for ai models and llm tooling.
- [agents](https://ai-powered.com/tools/agents-6): agents is an open-source AI tool for coding.
- [Aiproxy](https://ai-powered.com/tools/aiproxy): Aiproxy is an open-source AI tool for developer tools.
- [Reinwatch](https://ai-powered.com/tools/reinwatch): Reinwatch is an open-source AI tool for developer tools.
- [harnessrouter](https://ai-powered.com/tools/harnessrouter): harnessrouter is a freemium AI tool for developer tools.
- [SniffPup](https://ai-powered.com/tools/sniffpup-2): SniffPup is a freemium AI tool for developer tools.

---
Source: https://ai-powered.com/tools/agentshield-2
