toolairlock 0.3.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- toolairlock-0.3.0/.github/workflows/ci.yml +59 -0
- toolairlock-0.3.0/.github/workflows/publish.yml +64 -0
- toolairlock-0.3.0/.gitignore +16 -0
- toolairlock-0.3.0/CHANGELOG.md +73 -0
- toolairlock-0.3.0/CONTRIBUTING.md +15 -0
- toolairlock-0.3.0/LICENSE +21 -0
- toolairlock-0.3.0/PKG-INFO +709 -0
- toolairlock-0.3.0/README.md +663 -0
- toolairlock-0.3.0/SECURITY.md +19 -0
- toolairlock-0.3.0/bench/README.md +164 -0
- toolairlock-0.3.0/bench/__init__.py +1 -0
- toolairlock-0.3.0/bench/__main__.py +252 -0
- toolairlock-0.3.0/bench/cases/base_world.json +49 -0
- toolairlock-0.3.0/bench/cases/controls.json +123 -0
- toolairlock-0.3.0/bench/cases/exfil_destructive.json +310 -0
- toolairlock-0.3.0/bench/cases/indirect_injection.json +310 -0
- toolairlock-0.3.0/bench/cases/obfuscated_multilingual.json +222 -0
- toolairlock-0.3.0/bench/cases/payments_fraud.json +298 -0
- toolairlock-0.3.0/bench/configs.py +166 -0
- toolairlock-0.3.0/bench/dataset.py +87 -0
- toolairlock-0.3.0/bench/report.py +179 -0
- toolairlock-0.3.0/bench/results/offline/chart.svg +88 -0
- toolairlock-0.3.0/bench/results/offline/results.json +8334 -0
- toolairlock-0.3.0/bench/results/offline/results.md +32 -0
- toolairlock-0.3.0/bench/runner.py +334 -0
- toolairlock-0.3.0/bench/world.py +337 -0
- toolairlock-0.3.0/deploy/.env.example +14 -0
- toolairlock-0.3.0/deploy/README.md +39 -0
- toolairlock-0.3.0/deploy/docker-compose.yml +66 -0
- toolairlock-0.3.0/deploy/litellm-config.yaml +36 -0
- toolairlock-0.3.0/deploy/new-app-key.sh +12 -0
- toolairlock-0.3.0/docs/governance.md +160 -0
- toolairlock-0.3.0/examples/anthropic_loop.py +35 -0
- toolairlock-0.3.0/examples/demo_agent.py +515 -0
- toolairlock-0.3.0/examples/gateway/demo.py +311 -0
- toolairlock-0.3.0/examples/gateway/notes_server.py +140 -0
- toolairlock-0.3.0/examples/governance/ai-register.yaml +56 -0
- toolairlock-0.3.0/examples/governance/support_desk_after/.env.example +7 -0
- toolairlock-0.3.0/examples/governance/support_desk_after/.github/workflows/ai-governance.yml +67 -0
- toolairlock-0.3.0/examples/governance/support_desk_after/app.py +67 -0
- toolairlock-0.3.0/examples/governance/support_desk_after/evals/prompt.py +15 -0
- toolairlock-0.3.0/examples/governance/support_desk_after/evals/promptfooconfig.yaml +36 -0
- toolairlock-0.3.0/examples/governance/support_desk_after/evals/redteam.yaml +23 -0
- toolairlock-0.3.0/examples/governance/support_desk_after/governance/__init__.py +1 -0
- toolairlock-0.3.0/examples/governance/support_desk_after/governance/action_guard.py +41 -0
- toolairlock-0.3.0/examples/governance/support_desk_after/governance/llm.py +52 -0
- toolairlock-0.3.0/examples/governance/support_desk_after/governance/pii_guard.py +50 -0
- toolairlock-0.3.0/examples/governance/support_desk_after/prompts/system.yaml +7 -0
- toolairlock-0.3.0/examples/governance/support_desk_after/requirements.txt +3 -0
- toolairlock-0.3.0/examples/governance/support_desk_before/app.py +85 -0
- toolairlock-0.3.0/examples/governance/support_desk_before/requirements.txt +1 -0
- toolairlock-0.3.0/examples/governance/walkthrough.py +95 -0
- toolairlock-0.3.0/examples/mcp_server.py +25 -0
- toolairlock-0.3.0/examples/openai_loop.py +35 -0
- toolairlock-0.3.0/examples/tools.py +31 -0
- toolairlock-0.3.0/pyproject.toml +84 -0
- toolairlock-0.3.0/src/toolairlock/__init__.py +83 -0
- toolairlock-0.3.0/src/toolairlock/__main__.py +53 -0
- toolairlock-0.3.0/src/toolairlock/_version.py +5 -0
- toolairlock-0.3.0/src/toolairlock/adapters/__init__.py +36 -0
- toolairlock-0.3.0/src/toolairlock/adapters/langgraph.py +94 -0
- toolairlock-0.3.0/src/toolairlock/adapters/mcp.py +111 -0
- toolairlock-0.3.0/src/toolairlock/adapters/providers.py +473 -0
- toolairlock-0.3.0/src/toolairlock/adapters/tool_calling.py +228 -0
- toolairlock-0.3.0/src/toolairlock/approvals.py +130 -0
- toolairlock-0.3.0/src/toolairlock/audit.py +124 -0
- toolairlock-0.3.0/src/toolairlock/budget.py +106 -0
- toolairlock-0.3.0/src/toolairlock/dataflow.py +219 -0
- toolairlock-0.3.0/src/toolairlock/errors.py +100 -0
- toolairlock-0.3.0/src/toolairlock/gateway/__init__.py +29 -0
- toolairlock-0.3.0/src/toolairlock/gateway/cli.py +280 -0
- toolairlock-0.3.0/src/toolairlock/gateway/config.py +396 -0
- toolairlock-0.3.0/src/toolairlock/gateway/core.py +1224 -0
- toolairlock-0.3.0/src/toolairlock/gateway/http.py +254 -0
- toolairlock-0.3.0/src/toolairlock/gateway/jsonrpc.py +235 -0
- toolairlock-0.3.0/src/toolairlock/gateway/pins.py +138 -0
- toolairlock-0.3.0/src/toolairlock/gateway/ui.py +85 -0
- toolairlock-0.3.0/src/toolairlock/gateway/upstream.py +392 -0
- toolairlock-0.3.0/src/toolairlock/govern/__init__.py +42 -0
- toolairlock-0.3.0/src/toolairlock/govern/catalog.py +365 -0
- toolairlock-0.3.0/src/toolairlock/govern/checks.py +636 -0
- toolairlock-0.3.0/src/toolairlock/govern/classify.py +62 -0
- toolairlock-0.3.0/src/toolairlock/govern/cli.py +222 -0
- toolairlock-0.3.0/src/toolairlock/govern/engine.py +86 -0
- toolairlock-0.3.0/src/toolairlock/govern/live.py +179 -0
- toolairlock-0.3.0/src/toolairlock/govern/model.py +139 -0
- toolairlock-0.3.0/src/toolairlock/govern/register.py +267 -0
- toolairlock-0.3.0/src/toolairlock/govern/report.py +191 -0
- toolairlock-0.3.0/src/toolairlock/govern/scaffold.py +388 -0
- toolairlock-0.3.0/src/toolairlock/govern/scan.py +759 -0
- toolairlock-0.3.0/src/toolairlock/govern/templates/action_guard.py.tmpl +41 -0
- toolairlock-0.3.0/src/toolairlock/govern/templates/env.example.tmpl +7 -0
- toolairlock-0.3.0/src/toolairlock/govern/templates/github-workflow.yml.tmpl +35 -0
- toolairlock-0.3.0/src/toolairlock/govern/templates/gitlab-ci.yml.tmpl +21 -0
- toolairlock-0.3.0/src/toolairlock/govern/templates/llm_client.py.tmpl +52 -0
- toolairlock-0.3.0/src/toolairlock/govern/templates/pii_guard.py.tmpl +50 -0
- toolairlock-0.3.0/src/toolairlock/govern/templates/stack/README.md +39 -0
- toolairlock-0.3.0/src/toolairlock/govern/templates/stack/docker-compose.yml +66 -0
- toolairlock-0.3.0/src/toolairlock/govern/templates/stack/env.example +14 -0
- toolairlock-0.3.0/src/toolairlock/govern/templates/stack/litellm-config.yaml +36 -0
- toolairlock-0.3.0/src/toolairlock/govern/templates/stack/new-app-key.sh +12 -0
- toolairlock-0.3.0/src/toolairlock/govern/templates/system_prompt.yaml.tmpl +7 -0
- toolairlock-0.3.0/src/toolairlock/govern/testing.py +185 -0
- toolairlock-0.3.0/src/toolairlock/guard.py +757 -0
- toolairlock-0.3.0/src/toolairlock/injection.py +209 -0
- toolairlock-0.3.0/src/toolairlock/policy.py +92 -0
- toolairlock-0.3.0/src/toolairlock/provenance.py +201 -0
- toolairlock-0.3.0/src/toolairlock/py.typed +0 -0
- toolairlock-0.3.0/src/toolairlock/redact.py +177 -0
- toolairlock-0.3.0/src/toolairlock/schema.py +86 -0
- toolairlock-0.3.0/src/toolairlock/store.py +226 -0
- toolairlock-0.3.0/src/toolairlock/types.py +183 -0
- toolairlock-0.3.0/tests/conftest.py +100 -0
- toolairlock-0.3.0/tests/test_adapters.py +202 -0
- toolairlock-0.3.0/tests/test_approvals.py +179 -0
- toolairlock-0.3.0/tests/test_audit_redact.py +101 -0
- toolairlock-0.3.0/tests/test_bench.py +432 -0
- toolairlock-0.3.0/tests/test_budget.py +64 -0
- toolairlock-0.3.0/tests/test_dataflow.py +251 -0
- toolairlock-0.3.0/tests/test_demo.py +215 -0
- toolairlock-0.3.0/tests/test_gateway.py +684 -0
- toolairlock-0.3.0/tests/test_gateway_io.py +533 -0
- toolairlock-0.3.0/tests/test_gateway_jsonrpc.py +110 -0
- toolairlock-0.3.0/tests/test_govern.py +558 -0
- toolairlock-0.3.0/tests/test_guard.py +235 -0
- toolairlock-0.3.0/tests/test_idempotency.py +161 -0
- toolairlock-0.3.0/tests/test_injection_policy.py +206 -0
- toolairlock-0.3.0/tests/test_integrations.py +183 -0
- toolairlock-0.3.0/tests/test_provenance.py +95 -0
- toolairlock-0.3.0/tests/test_providers.py +455 -0
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
contents: read
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
lint:
|
|
13
|
+
runs-on: ubuntu-latest
|
|
14
|
+
steps:
|
|
15
|
+
- uses: actions/checkout@v4
|
|
16
|
+
- uses: actions/setup-python@v5
|
|
17
|
+
with:
|
|
18
|
+
python-version: "3.12"
|
|
19
|
+
- run: pip install -e ".[dev]"
|
|
20
|
+
- run: ruff check .
|
|
21
|
+
- run: ruff format --check .
|
|
22
|
+
- run: mypy src
|
|
23
|
+
|
|
24
|
+
test:
|
|
25
|
+
runs-on: ubuntu-latest
|
|
26
|
+
strategy:
|
|
27
|
+
fail-fast: false
|
|
28
|
+
matrix:
|
|
29
|
+
python-version: ["3.10", "3.11", "3.12", "3.13"]
|
|
30
|
+
steps:
|
|
31
|
+
- uses: actions/checkout@v4
|
|
32
|
+
- uses: actions/setup-python@v5
|
|
33
|
+
with:
|
|
34
|
+
python-version: ${{ matrix.python-version }}
|
|
35
|
+
- run: pip install -e ".[dev]"
|
|
36
|
+
- run: pytest --cov --cov-report=term-missing --cov-fail-under=90
|
|
37
|
+
- name: Run the offline demo
|
|
38
|
+
run: python examples/demo_agent.py
|
|
39
|
+
- name: Attack benchmark (offline gate)
|
|
40
|
+
run: |
|
|
41
|
+
python -m bench validate
|
|
42
|
+
python -m bench run --quiet --out "$RUNNER_TEMP/bench" --fail-over checklist=15
|
|
43
|
+
- name: Run the governance walkthrough
|
|
44
|
+
run: python examples/governance/walkthrough.py
|
|
45
|
+
- name: deploy/ matches the packaged stack
|
|
46
|
+
run: |
|
|
47
|
+
python -m toolairlock govern stack --out /tmp/stack
|
|
48
|
+
diff -r deploy /tmp/stack
|
|
49
|
+
|
|
50
|
+
integrations:
|
|
51
|
+
name: integrations (MCP + LangGraph)
|
|
52
|
+
runs-on: ubuntu-latest
|
|
53
|
+
steps:
|
|
54
|
+
- uses: actions/checkout@v4
|
|
55
|
+
- uses: actions/setup-python@v5
|
|
56
|
+
with:
|
|
57
|
+
python-version: "3.12"
|
|
58
|
+
- run: pip install -e ".[dev,mcp,langgraph]"
|
|
59
|
+
- run: pytest tests/test_integrations.py -v -rs
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
name: Publish to PyPI
|
|
2
|
+
|
|
3
|
+
# Runs when a version tag (v0.3.0 or V0.3.0) is pushed, or by hand for an existing tag
|
|
4
|
+
# (Actions > Publish to PyPI > Run workflow). Uses PyPI trusted publishing (OIDC):
|
|
5
|
+
# no API token is stored anywhere.
|
|
6
|
+
|
|
7
|
+
on:
|
|
8
|
+
push:
|
|
9
|
+
tags: ["v*", "V*"]
|
|
10
|
+
workflow_dispatch:
|
|
11
|
+
inputs:
|
|
12
|
+
tag:
|
|
13
|
+
description: "Existing release tag to build and publish, e.g. v0.3.0"
|
|
14
|
+
required: true
|
|
15
|
+
|
|
16
|
+
permissions:
|
|
17
|
+
contents: read
|
|
18
|
+
|
|
19
|
+
jobs:
|
|
20
|
+
build:
|
|
21
|
+
runs-on: ubuntu-latest
|
|
22
|
+
steps:
|
|
23
|
+
- uses: actions/checkout@v4
|
|
24
|
+
with:
|
|
25
|
+
ref: ${{ inputs.tag || github.ref }}
|
|
26
|
+
- uses: actions/setup-python@v5
|
|
27
|
+
with:
|
|
28
|
+
python-version: "3.12"
|
|
29
|
+
- name: Check the tag matches the package version
|
|
30
|
+
env:
|
|
31
|
+
TAG: ${{ inputs.tag || github.ref_name }}
|
|
32
|
+
run: |
|
|
33
|
+
version=$(python -c "import re,pathlib; print(re.search(r'__version__ = \"([^\"]+)\"', pathlib.Path('src/toolairlock/_version.py').read_text()).group(1))")
|
|
34
|
+
tag="${TAG#[vV]}"
|
|
35
|
+
echo "package $version, tag $tag"
|
|
36
|
+
test "$version" = "$tag"
|
|
37
|
+
- run: python -m pip install --upgrade build twine
|
|
38
|
+
- run: python -m build
|
|
39
|
+
- run: python -m twine check --strict dist/*
|
|
40
|
+
- name: Smoke test the wheel
|
|
41
|
+
run: |
|
|
42
|
+
python -m venv /tmp/smoke
|
|
43
|
+
/tmp/smoke/bin/pip install dist/*.whl
|
|
44
|
+
/tmp/smoke/bin/toolairlock --help
|
|
45
|
+
/tmp/smoke/bin/python -c "import toolairlock; print(toolairlock.__version__)"
|
|
46
|
+
- uses: actions/upload-artifact@v4
|
|
47
|
+
with:
|
|
48
|
+
name: dist
|
|
49
|
+
path: dist/
|
|
50
|
+
|
|
51
|
+
publish:
|
|
52
|
+
needs: build
|
|
53
|
+
runs-on: ubuntu-latest
|
|
54
|
+
environment:
|
|
55
|
+
name: pypi
|
|
56
|
+
url: https://pypi.org/project/toolairlock/
|
|
57
|
+
permissions:
|
|
58
|
+
id-token: write
|
|
59
|
+
steps:
|
|
60
|
+
- uses: actions/download-artifact@v4
|
|
61
|
+
with:
|
|
62
|
+
name: dist
|
|
63
|
+
path: dist/
|
|
64
|
+
- uses: pypa/gh-action-pypi-publish@release/v1
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 0.3.0 (2026-12-04)
|
|
4
|
+
|
|
5
|
+
First release on PyPI: `pip install toolairlock`.
|
|
6
|
+
|
|
7
|
+
Governance as code for whole AI systems: `toolairlock govern` (extra `toolairlock[govern]`, adds PyYAML; the core stays dependency-free).
|
|
8
|
+
|
|
9
|
+
- `govern classify`: tier from the code (A non-AI, B LLM calls, C RAG, D agentic). Python by AST, JS/TS by pattern.
|
|
10
|
+
- `govern init`: register entry plus a thin integration: LLM gateway client with `app:` and `use-case:` tags, PII guard (Presidio or a regex fallback), output scan, an `Airlock`-based action guard for tier D, a versioned prompt, promptfoo evals and red team, GitHub or GitLab CI. Never scaffolds below the detected tier.
|
|
11
|
+
- `govern check`: 26 controls over inventory, gateway, observability, guardrails, evals, policy, RAG and agents. Evidence is live (LiteLLM `/key/info`, `/spend/logs/v2`, `/guardrails/list`; Langfuse `/api/public/traces`, read with the app's own key), static (code, CI, eval configs) or register. Unreachable live evidence is `unverified`, never `pass`. Score, verdict, "fix first" list, OWASP LLM Top 10 (2025) and NIST AI RMF coverage, Markdown or JSON, `--fail-under` and `--strict` for CI. `--audit-log` verifies a real audit hash chain.
|
|
12
|
+
- `govern approve`: reviewer approval bound to a SHA-256 of the register entry; edits make it stale, owners can't approve their own app, approvals expire after `approval_max_age_days`.
|
|
13
|
+
- `govern keyspec`: the gateway `/key/generate` body (budget, rate limits, models, tags) from the register.
|
|
14
|
+
- `govern stack`: reference central stack (LiteLLM, Postgres, Presidio) as docker compose, also in `deploy/`.
|
|
15
|
+
- `toolairlock.govern.testing.FakeStack`: local fake gateway and tracer for tests and demos.
|
|
16
|
+
- Tested against a real LiteLLM proxy v1.112.1: refused calls are logged with `status: failure`, so they are now counted apart from served calls and shown as evidence that the allowlist works. See `docs/governance.md`.
|
|
17
|
+
- Example: `examples/governance/` (an unguarded support agent and its governed version) and `walkthrough.py`, run in CI.
|
|
18
|
+
|
|
19
|
+
## 0.2.0 (unreleased)
|
|
20
|
+
|
|
21
|
+
Taint now follows where data came from, not only what it says.
|
|
22
|
+
|
|
23
|
+
- **Fix (behaviour change):** a live run of `--scenario subtle` showed the gap. The look-alike vendor mail had no injection markers, so the inbox read scored `risk=none` and the agent was never tainted. Now any read of an `untrusted_output` tool taints the actor, whatever the text says (`Policy.taint_untrusted="always"`, the new default). `"flagged"` keeps the 0.1 behaviour.
|
|
24
|
+
- `toolairlock.provenance`: `check_senders`, `sender_findings`, `lookalike_of`. Flags senders outside an allowlist and look-alike domains (extra words, other TLD, typos, `rn`/`m`, digits for letters, Cyrillic and Greek homoglyphs, punycode) as `high` risk. Plug in with `register(..., output_check=...)`; a check that raises fails closed (`output_check_error`, high).
|
|
25
|
+
- `toolairlock.dataflow`: data-level taint. Values from untrusted reads are remembered per actor; `trusted_output=True` tools and `Airlock.record_trusted()` vouch for values. `Policy.arg_rules` blocks (`TaintedArgument`, code `tainted_argument`) or escalates a call per argument. `Preview.untrusted_args` and `ApprovalRequest.untrusted_args` show which argument came from where; the approval `reason` lists the sources.
|
|
26
|
+
- `Policy.actor_taint_fallback` (default on): keep agent-level escalation for every tool. Off: tools with `arg_rules` are judged on their arguments alone.
|
|
27
|
+
- `AgentLoop(trust_prompts=True)` records each user prompt as a trusted source.
|
|
28
|
+
- `Airlock.taint_sources(actor)` says why an actor is tainted; `clear_taint` also clears value flows.
|
|
29
|
+
- `AgentLoop` recovers when the provider rejects the model's own tool call (Groq `400 tool_use_failed`, malformed arguments): it feeds a short error back to the model and retries, up to `max_tool_call_errors` (default 2) in a row, then stops with `stopped="tool_call_errors"`. `LoopResult.tool_call_errors` counts them; `is_tool_call_error(exc)` tells them apart from real API failures.
|
|
30
|
+
- Other `ProviderError`s raised out of `AgentLoop.run` carry `partial`, the `LoopResult` so far, so callers can still report what ran.
|
|
31
|
+
- Attack benchmark in `bench/`: 45 attack cases and 7 controls, ASR and task utility for no guard, rubber-stamp approvals and checklist reviewers, offline scripted mode (CI gate: checklist ASR at most 15%) and live mode for Groq, Ollama, OpenAI and Anthropic. Writes JSON, markdown and an SVG chart.
|
|
32
|
+
- Benchmark live runs: errors print their reason, per-minute 429s wait as long as the API asks, a per-day cap stops that model cleanly for `--resume` instead of failing every remaining case, rejected tool calls go back to the model, and `python -m bench errors` lists errored cases.
|
|
33
|
+
- README: real live transcript of `--scenario subtle` on Groq (`qwen/qwen3.8-27b`, 0.2.0).
|
|
34
|
+
- Demo: live header shows the toolairlock version, the summary lists taint sources, and the audit trail and verdict print even when the model API fails (exit 2).
|
|
35
|
+
- Demo: `read_inbox` uses `check_senders`, new trusted `open_invoices` tool, per-argument rules on `pay_*` and `send_email`, approvers reject values that only appear in a mail.
|
|
36
|
+
|
|
37
|
+
### MCP gateway
|
|
38
|
+
|
|
39
|
+
- `toolairlock gateway`: a drop-in MCP proxy. Point Claude Desktop, Cursor or any MCP client at it and it fronts one or more upstream MCP servers (stdio or streamable HTTP) with no code change on either side.
|
|
40
|
+
- Per-tool policy in `airlock.toml`: effect, approval, cost, idempotency, hide and deny rules by glob; reads pass through, writes run deduped and budgeted, destructive and external calls go through preview, approval and `airlock_commit`.
|
|
41
|
+
- Approvals in the client (MCP elicitation), in a loopback web console, from the terminal (`gateway pending / approve / reject / kill`) or by webhook. The client can't approve its own calls.
|
|
42
|
+
- Tool pinning: definitions are fingerprinted in a lockfile; a changed definition (rug pull) or a new tool can be blocked until reviewed. `gateway pin --check` for CI.
|
|
43
|
+
- Tool poisoning checks: descriptions and schemas are scanned for injections and for cross-server shadowing (one server's description steering another server's tool); such tools are quarantined.
|
|
44
|
+
- Upstream output is fenced as untrusted, high-risk content taints the session, and every decision lands in the hash-chained audit log.
|
|
45
|
+
- Streamable HTTP serving (`--http`), with a bearer token required off loopback.
|
|
46
|
+
- `examples/gateway/`: a zero-dependency notes MCP server and a 12-scene scripted demo.
|
|
47
|
+
|
|
48
|
+
## 0.1.1 (unreleased)
|
|
49
|
+
|
|
50
|
+
- Send a `toolairlock/<version>` User-Agent on every HTTP request (model clients and the webhook approver). Groq's Cloudflare front rejected Python's default `Python-urllib` agent with HTTP 403 "error code: 1010".
|
|
51
|
+
- Model clients also send `accept: application/json`; caller headers still override the defaults.
|
|
52
|
+
- README: real `--llm groq` transcript, PowerShell setup, note on current tool-use model ids.
|
|
53
|
+
- Previews and approval requests now use `review_redactor` (default: secrets hidden, PII visible), so a reviewer can see who an email or payment goes to. Previously the recipient showed as `[EMAIL]`, which made an informed approval impossible. The audit log still redacts PII.
|
|
54
|
+
- Custom `preview=` summaries are now passed through `review_redactor` too.
|
|
55
|
+
- Demo: `--scenario subtle` (look-alike vendor bank-change fraud plus contract exfiltration), `read_file` tool, `account` on `pay_invoice` checked against a vendor master, and a scripted "yes, go ahead" in live mode (`--no-confirm` to skip).
|
|
56
|
+
- Version now lives in one place (`toolairlock/_version.py`).
|
|
57
|
+
|
|
58
|
+
## 0.1.0 (unreleased)
|
|
59
|
+
|
|
60
|
+
First public version.
|
|
61
|
+
|
|
62
|
+
- `Airlock` with preview → approve → commit for side-effect tools, single-use tokens with TTL
|
|
63
|
+
- Approval modes: auto, human, two-person, deny; maker-checker by default
|
|
64
|
+
- Approvers: callback, CLI, webhook (out of band), LangGraph `interrupt()`
|
|
65
|
+
- Idempotency: in-memory and SQLite stores, replay instead of re-execute
|
|
66
|
+
- Budgets and rate limits with reservation and refund
|
|
67
|
+
- Kill switch: `TOOLAIRLOCK_MODE` env var can only tighten the mode
|
|
68
|
+
- Tamper-evident JSONL audit log with hash chain and `toolairlock verify`
|
|
69
|
+
- Redaction of secrets and PII (Luhn and Verhoeff checked) before logging
|
|
70
|
+
- LLM-free prompt-injection scanner, spotlighting, and taint escalation
|
|
71
|
+
- Adapters: OpenAI (Chat + Responses), Anthropic, LangChain-style calls, LangGraph node, MCP server (SDK 1.x and 2.x)
|
|
72
|
+
- Zero-dependency model clients for Groq, Ollama (native and /v1), OpenAI-compatible servers and Anthropic, plus `AgentLoop`
|
|
73
|
+
- Demo runs offline by default or with a real model via `--llm`
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Contributing
|
|
2
|
+
|
|
3
|
+
```bash
|
|
4
|
+
python -m venv .venv && . .venv/bin/activate
|
|
5
|
+
pip install -e ".[dev,mcp,langgraph]"
|
|
6
|
+
pytest --cov
|
|
7
|
+
ruff check . && ruff format --check . && mypy src
|
|
8
|
+
python examples/demo_agent.py
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Rules of thumb:
|
|
12
|
+
|
|
13
|
+
- Every refusal is an `AirlockBlocked` subclass with a stable `code`.
|
|
14
|
+
- Fail closed: if a check can't run, the call doesn't run.
|
|
15
|
+
- New behaviour needs a test, and the demo must keep passing.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Eidan Ansari
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|