Skip to main content

Runtime security for AI coding agents: policy enforcement, secret prevention, and supply-chain blocking.

Project description

Immunity Agent

Runtime security for AI coding agents. Policy enforcement, secret prevention, supply-chain blocking, and session auditing — all running locally on your machine.


What it does

AI coding agents execute shell commands, read files, call APIs, and install packages autonomously. Immunity Agent sits between the agent and the operating system to:

  • Block dangerous actions before they run — destructive commands, privilege escalation, reverse shells, secret exfiltration
  • Intercept package installs and score them for supply-chain risk before they touch your disk
  • Prevent secrets from reaching the model — register a secret under a placeholder name; the hook substitutes the real value at execution time
  • Log every tool call to a local SQLite store for session review and auditing

Supports Claude Code, Cursor, Windsurf, and more.


Install

pip install immunity-agent

Requires Python ≥ 3.8 and PyYAML (installed automatically).


Quick start

Install Warden hooks into your project (enforces policy on every agent tool call):

immunity install-hooks --agent claude --workspace . --mode observe

Start in observe mode to log would-be blocks without interrupting the agent. Switch to enforce when ready:

immunity install-hooks --agent claude --workspace . --mode enforce

Wrap your package manager to score installs before they run:

immunity supplychain npm install express
immunity supplychain pip install requests
immunity supplychain cargo add serde

Check a command against policy before running it:

immunity check "rm -rf /"
# BLOCK  destructive_command  CRITICAL

Audit your workspace security posture:

immunity audit

Scan AI tool configs for leaked secrets:

immunity sweep

Launch the self-hosted dashboard (reads from local SQLite, no cloud):

immunity dashboard   # opens http://127.0.0.1:7070 in your browser

Detection coverage

Warden ships with 56 rules covering the OWASP Top 10 for LLM Applications:

Category Severity What it catches
Destructive command CRITICAL rm -rf /, mkfs, dd to disk
Secret exfiltration CRITICAL cat .env | curl, piping credentials outbound
RCE canary CRITICAL Reverse shells, bash -i /dev/tcp
Privilege escalation CRITICAL chmod +s, sudoers edits, useradd
Remote execution HIGH curl | bash, wget | sh
Secret access HIGH Reads of .env, .aws/credentials, .ssh/id_rsa
Path traversal HIGH ../../etc/passwd, /proc/self/environ
DB modification HIGH DROP TABLE, DELETE FROM in shell commands
Prompt injection HIGH ignore instructions, reveal system prompt
Risky write MEDIUM Edits to Dockerfile, CI workflows, package.json

Rules are defined in YAML and fully customizable per-project.


Supply chain enforcement

The immunity CLI wraps your package manager and evaluates every install against live threat intelligence before it runs. Packages are scored on age, maintainer count, install scripts, and known IOCs. Ships with IOC coverage for recent attacks including the AntV hijacked-maintainer attack (May 2026) and the mini-shai-hulud campaign (May 2026).

immunity supplychain npm install @tanstack/react-router
  BLOCK  score 100  @tanstack/react-router
         42 @tanstack/* packages compromised via CI/CD cache poisoning

Verdicts: < 30 allow · 30–59 warn · ≥ 60 block. IOC matches always block.


Secret cloaking

Register a secret under a placeholder name:

immunity cloak add stripe_key
# prompts for the value — never stored in shell history

Reference it in agent instructions:

Run: curl https://api.stripe.com -H "Authorization: Bearer @@SECRET:stripe_key@@"

The pre-tool-use hook substitutes the real value at execution time. The post-tool-use hook scrubs any echoed value from output before it returns to the model.


Modes

Mode Behaviour
observe Logs all findings, never blocks. Good for the first 24–48 h on a new workspace.
enforce Blocks dangerous actions in real time before the agent executes them.

Links

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

immunity_agent-1.10.0.tar.gz (353.2 kB view details)

Uploaded Source

Built Distribution

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

immunity_agent-1.10.0-py3-none-any.whl (404.5 kB view details)

Uploaded Python 3

File details

Details for the file immunity_agent-1.10.0.tar.gz.

File metadata

  • Download URL: immunity_agent-1.10.0.tar.gz
  • Upload date:
  • Size: 353.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for immunity_agent-1.10.0.tar.gz
Algorithm Hash digest
SHA256 76107afc81b528808f0e732aaaab209ca93d0076769b0d2adfd63c741f502e36
MD5 2b27a66f4d9ce947bb3ab1a535a0afc9
BLAKE2b-256 4258925f8f58bbfaab3f0ad2f8e93ec811ba185aeb75032282ddb0dfcf23c36a

See more details on using hashes here.

Provenance

The following attestation bundles were made for immunity_agent-1.10.0.tar.gz:

Publisher: release.yml on PrismorSec/immunity-agent

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

File details

Details for the file immunity_agent-1.10.0-py3-none-any.whl.

File metadata

  • Download URL: immunity_agent-1.10.0-py3-none-any.whl
  • Upload date:
  • Size: 404.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for immunity_agent-1.10.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1d715ac1f4f626830bc38b61101f80d0d6eaf2e87b7edb2206fde2a8fd7a75b6
MD5 4383040f320e9fdb5d9f2e0ef4570164
BLAKE2b-256 c99cf7991266db5308fbed914d186da72effc660ba5100635eb968fefdd141ba

See more details on using hashes here.

Provenance

The following attestation bundles were made for immunity_agent-1.10.0-py3-none-any.whl:

Publisher: release.yml on PrismorSec/immunity-agent

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