Skip to main content

Safety checks an AI agent runs before it acts: is this package malware/typosquat, is this shell command destructive, does this text leak a secret. CLI + MCP server.

Project description

agent-guard

The safety check an AI agent runs before it acts.

Every agent that installs packages, runs shell commands, or commits/outputs text can do real damage: install malware, wipe a disk, or leak a credential. agent-guard is three cheap, dependency-free checks — the "look before you leap" gate an agent (or you) calls before the irreversible step.

pip install agent-tripwire            # the checks (zero deps)
pip install "agent-tripwire[mcp]"     # + the MCP server for agents

Use it as an MCP tool (for agents)

An agent can call these itself before acting. Add to your MCP client (Claude/Cursor/Claude Code):

{ "mcpServers": { "agent-guard": { "command": "agent-guard-mcp" } } }

MCP registry identity — mcp-name: io.github.ipezygj/agent-guard

tool the agent calls it before…
check_package pip/npm install — is it real, malware, a typosquat, or does it run code on install?
check_command running a shell command — is it a destructive / remote-code-exec vector (rm -rf, curl|bash, dd, force-push)?
scan_secrets committing / pasting / logging — does the text leak an API key, token, or private key?

The three checks

check_package — existence on the registry (a hallucinated name is a red flag), typosquat distance to popular packages, npm install/postinstall scripts (the classic supply-chain malware vector), and OSV malware/vulnerability advisories. Mainstream packages pass; look-alikes and install-time-code flag.

check_command — matches destructive / RCE shell patterns with a severity and a plain reason. rm -rf /, curl … | bash, dd of=/dev/sda, fork bombs → critical; force-push, hard-reset, sudo, DROP TABLE → high.

scan_secrets — AWS/OpenAI/Anthropic/Google/Stripe/GitHub/Slack keys, private-key blocks, JWTs, and generic api_key=/password= assignments. Returns each finding (type, line, redacted).

from agent_guard import analyze_command, scan_secrets, check_package
analyze_command("rm -rf /")["danger"]           # "critical"
scan_secrets("token = 'ghp_...'")["leaked"]     # True
check_package("reqwests", "pypi")["risk"]       # "high" (typosquat of requests)

The point: an agent about to install/run/commit should check first — and now it can, in one call, with a plain verdict and a recommendation. If a check comes back high/critical, stop and get a human.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

agent_tripwire-0.1.0.tar.gz (11.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

agent_tripwire-0.1.0-py3-none-any.whl (12.0 kB view details)

Uploaded Python 3

File details

Details for the file agent_tripwire-0.1.0.tar.gz.

File metadata

  • Download URL: agent_tripwire-0.1.0.tar.gz
  • Upload date:
  • Size: 11.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for agent_tripwire-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ed318b0aa086f5924345cdd492e33a8b0d986ebdb05b5a7562661e4e57bc012c
MD5 ce7e0d3ee6c163d9437e02131c5a8d20
BLAKE2b-256 d421201b507ba1b21b3f088c73ff2912d3808ef20b391c0b013d511e2161a86c

See more details on using hashes here.

Provenance

The following attestation bundles were made for agent_tripwire-0.1.0.tar.gz:

Publisher: publish.yml on ipezygj/agent-guard

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file agent_tripwire-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: agent_tripwire-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 12.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for agent_tripwire-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 56e4081a1cac86a29b7e08c05c8251269c0d5f947747d05ff8d2090ba8fc5857
MD5 52061c948730f1dc451ef5fc9e204890
BLAKE2b-256 f322ff3ea8cfa00dbf066074952439c2ca0005e046f64ffa1bc355c1c9afe75c

See more details on using hashes here.

Provenance

The following attestation bundles were made for agent_tripwire-0.1.0-py3-none-any.whl:

Publisher: publish.yml on ipezygj/agent-guard

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page