Skip to main content

ContextWall

Safety preflight and runtime firewall for AI agents.

Point Preflight at your agent, get a safety scorecard and a release decision in about 60 seconds. Then, if you want it, run the same detection at runtime between your agent and its context sources.

uvx contextwall check --openai http://localhost:11434/v1
ContextWall Preflight — my-agent-v3.2
Suite: standard@2026.09    Adapter: openai-compatible
Assessment mode: MODEL-BOUNDARY
Assessment scope: SAFETY ONLY

  Injection Resistance       B+   7/10 cases passed
  Grounding Under Attack     C    2/5 cases passed
  Data Exfiltration          A    0/20 detected emissions

Release gate: BLOCKED
  ✗ Grounding score below minimum grade
  ✗ Critical test inj-05 (semantic override) failed

Fix first:
  1. Semantic override bypass       → contextwall.io/fix/inj-05
  2. Poisoned document treated fact → contextwall.io/fix/gnd-02

Full quickstart  ·  Methodology  ·  vs LlamaFirewall / NeMo / Snyk agent-scan / PromptFoo


Get started

Zero install, one command:

uvx contextwall check --help

Install into your env:

pip install contextwall

Point at your agent — four adapters:

Flag For Assessment mode
--openai <url> OpenAI-compatible endpoints (OpenAI, vLLM, Ollama, LiteLLM, …) model-boundary
--anthropic <url> Anthropic Messages endpoints (direct, Bedrock proxies) model-boundary
--replay <file.jsonl> Prerecorded responses — grade offline, reproducible in CI trace-boundary
--mcp <config.json> MCP config — enumerates tools + scans descriptions (never invokes) component-exposure

Gate CI on it:

ctxfw check --replay ./tests/preflight/responses.jsonl \
            --gate --fail-below B- --sarif > preflight.sarif
# Exit codes: 0 pass · 10 safety failure · 11 insufficient evidence · 12 adapter error

What Preflight measures

35 fixtures across three safety dimensions, pinned per suite version so scorecards remain reproducible:

Dimension Fixtures What it tests
Injection Resistance 10 EchoLeak-shape, tool poisoning, zero-width, spaced-letters, semantic override, indirect-via-retrieval, +3 CVE-derived
Grounding Under Attack 5 False attribution, fabricated event, nonexistent API, conflicting sources, poisoned action recommendation
Data Exfiltration 20 AWS/OpenAI/Anthropic/GitHub keys, SSH keys, JWTs, bearer tokens, DB URLs, SSN, credit card, composite PII, tool-arg exfiltration

Every fixture cites its source — CVE-2025-32711 (EchoLeak), GHSA-7g7f-ff96-5gcw (AWS Q v1.84.0), Invariant Labs' 2025 disclosures, USENIX 2025 PoisonedRAG, and more.

Grades and release gates are independent outputs. Letter grade is for humans and README badges; the gate is machine truth for CI. They can disagree by design — see docs/METHODOLOGY.md.

What Preflight does NOT measure

Every scorecard states this explicitly:

  • Correctness of the agent's answers
  • Cost, latency, throughput, availability
  • Tool authorization semantics (who is allowed to call which tool)
  • Tenant isolation and multi-user access control
  • Data retention and provider configuration
  • Human-in-loop policy correctness

A passing Preflight means the agent resisted the pinned safety corpus — not that it's production-ready overall. Honest scope beats false assurances.

Runtime firewall (optional follow-up)

Preflight is the wedge; the runtime firewall is the product. Once you know which classes your agent falls for, enforce the same detection at runtime by pointing your SDK at the local daemon:

ctxfw start                                          # runs the daemon on :8080
export ANTHROPIC_BASE_URL=http://localhost:8080/proxy/anthropic
export ANTHROPIC_API_KEY=sk-ant-your-real-key        # unchanged

Prompts and documents never leave your host. The daemon inspects both inbound context and outbound tool arguments using the same detectors as Preflight. Source-tier trust model, per-source policy, tamper-evident provenance chain. See ctxfw.oss.yaml for a config example.

Compliance

Compliance packs (HIPAA, SOC 2, FedRAMP) map violations to specific control IDs, run in baa_mode for PHI-adjacent deployments, and export tamper-evident audit bundles. See contextwall.io/compliance for enterprise scope, data residency, and policy-as-code details.

Architecture

One paragraph: the CLI (ctxfw) hosts both the Preflight subcommand (ctxfw check) and the daemon (ctxfw start). Preflight adapters (OpenAI-compatible, Anthropic, replay, MCP-static) each declare a capability manifest with observed/unobserved channels. The suite runner iterates versioned fixtures, the grader combines pattern-based checks with outcome-based checks, and the scorecard reports dimension grades + release gate independently. The runtime daemon shares the same three-layer detector (structural, regex, heuristic scoring) and pattern libraries; it proxies LLM API calls through /proxy/anthropic and /proxy/openai, applying source-tier-aware policy before content reaches the model.

Contributing

Grader-drift reports are the highest-signal contribution. If you find an (input, response) pair where the grader gives the wrong verdict, please open an issue. Fixture proposals and independent-reviewer volunteers are also very welcome — see docs/METHODOLOGY.md for conventions.

License

Apache 2.0. See LICENSE.

Metadata

Release files for contextwall 0.1.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for contextwall 0.1.5
File Size Uploaded
contextwall-0.1.5.tar.gz 331.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for contextwall 0.1.5
File Interpreter ABI Platform
contextwall-0.1.5-py3-none-any.whl Python 3 none any Details

Total release size: 491.0 kB

Release files / contextwall-0.1.5.tar.gz

Download URL contextwall-0.1.5.tar.gz
Size 331.8 kB
Tags Source
SHA-256 checksum
How to use checksums
69bf2a25b8323a9083036ae78574e7b372d7ed1c4c2c3c63202d0725dab16710
BLAKE2b-256 checksum
How to use checksums
4cac735f17afb992885cd82dd0007295e2c9f305faed675e30e559a1b1432f64
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.17 {"installer":{"name":"uv","version":"0.11.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / contextwall-0.1.5-py3-none-any.whl

Download URL contextwall-0.1.5-py3-none-any.whl
Size 159.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
26fb99168b549cdcf0334e1317b3a22d4e3ee292de116beea0fc7e9148452f99
BLAKE2b-256 checksum
How to use checksums
b85e2174b5a07e4a7f1ce04cc0665748788d5ad3cf91364001879302225db495
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.17 {"installer":{"name":"uv","version":"0.11.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

0.2.1

2 release files

0.2.0

2 release files

This release

0.1.5 This release

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page