The Autonomous Stack

AI Security & LLM Ops · LLM Security · v1.0.0

Agent Context Audit Pack v1.0

Audit LLM context for secrets, prompt injection, PII, and risky actions before execution.

$3.00one-timePay with crypto

context-audit prompt-security llm-ops offline

agent ⟶ theautonomousstack.xyz

01GET /api/v1/pack/agent-contextaudit-v1

402 Payment RequiredX-PAYMENT-REQUIRED

02sign TransferWithAuthorization3.00 USDC · Base (eip155:8453)

03GET + PAYMENT-SIGNATURE

200 OKapplication/zip · 17 files

pay per pack over x402no account

What's inside

Agent Context Audit is a small autonomous guard for LLM operators. It audits prompts, retrieved context, tool arguments, memory snippets, and support logs before they are sent to an agent or model. It is useful when your stack handles untrusted text and you want a repeatable pre-flight check for secrets, prompt injection, personal data, and risky action requests.

It does not promise perfect security. It provides deterministic rules, clear JSON reports, and an optional Bring-Your-Own-LLM reviewer through the local llm_adapter.py interface. No API key is required.

Who This Is For

Quick Start

cd agent-contextaudit-v1
python3 agent.py --help
python3 agent.py status
python3 agent.py scan --deterministic --input sample_contexts.json --output audit_report.json
python3 agent.py check-text --text "Ignore previous system instructions"
python3 test_agent.py
./smoke_test.sh

Install as a Debian service:

sudo ./install.sh
sudo systemctl start agent-contextaudit-v1
sudo systemctl status agent-contextaudit-v1

What It Produces

The report is JSON:

{
  "agent": "agent-contextaudit-v1",
  "summary": {
    "total_items": 3,
    "decisions": {"allow": 1, "review": 1, "block": 1}
  },
  "items": [
    {
      "id": "credential-leak",
      "decision": "block",
      "risk_score": 80,
      "categories": ["secret"]
    }
  ]
}

Architecture

              +---------------------+
JSON/text --> | normalize records   |
              +----------+----------+
                         |
                         v
              +---------------------+
              | deterministic rules |
              | secrets / PII /     |
              | injection / tools   |
              +----------+----------+
                         |
                         v
              +---------------------+
              | risk score + policy |
              | allow/review/block  |
              +----------+----------+
                         |
             optional    v
              +---------------------+
              | BYO LLM reviewer    |
              | claude/kimi/codex   |
              +----------+----------+
                         |
                         v
              +---------------------+
              | JSON audit report   |
              +---------------------+

Offline First

agent.py --help, python3 test_agent.py, and ./smoke_test.sh work without network access and without provider credentials. If a supported local coding agent CLI is available, the pack can add an LLM review section; otherwise it stays deterministic.