A human-approval gate for the dangerous things an AI agent does.
Project description
airlock (Python)
A human-approval gate for the dangerous things an AI agent does. This is the Python package; see the repository root for the full story, the quickstart, and the TypeScript package. It mirrors the TypeScript package one-to-one (same design, same names).
Install
pip install airlock-hitl # or: uv add airlock-hitl
The distribution is named airlock-hitl; the import is airlock:
from airlock import Agent, RiskTier
Requires Python 3.13+.
What you get
- An
Agentthat runs a tool-use loop and pauses before any tool you markRiskTier.SENSITIVE, until a human approves, edits, or rejects it. - Model-agnostic providers (
AnthropicProvider,OpenAiProvider) over an injectedhttpxclient — no SDKs. - Redis store and Pub/Sub bus for pause/resume across processes, plus in-memory fakes for tests and demos.
See the root quickstart for a ~20-line example.
Layout (hexagonal — imports point inward)
src/airlock/domain— tools, risk tiers, messages, runs, events, errors. No I/O.src/airlock/application— the agent loop, the gate policy, and the ports (Protocols).src/airlock/infrastructure— adapters: providers, the Redis store and bus, audit sinks, clocks, id generators, and the in-memory fakes.src/airlock/interface— driving adapters: the runner and the approver.src/airlock/core—Settings(pydantic-settings).examples/support_agent— a runnable demo (see its README).
Commands
| Command | What it does |
|---|---|
uv run ruff check . && uv run ruff format --check . |
lint + format |
uv run mypy |
mypy --strict |
uv run lint-imports |
hexagonal import contracts |
uv run pytest |
unit + eval tests with coverage (≥ 90%) |
uv run pytest tests/integration --no-cov |
Redis integration tests |
Built and tested to CODING_PRINCIPLES.md. From the
repo root, make py-check runs the full gate.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file airlock_hitl-0.1.0.tar.gz.
File metadata
- Download URL: airlock_hitl-0.1.0.tar.gz
- Upload date:
- Size: 58.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
859ba37fea751a6f9343f6a46cb2e37731baf57867bc9458ae95d5e2f7395e9c
|
|
| MD5 |
43a059b64f9f5d33c28b9dd9012e2e5c
|
|
| BLAKE2b-256 |
268250640cb5e82663ccebbd707ac205adac58f366fc1b8ea21e08ff3ef00a3a
|
Provenance
The following attestation bundles were made for airlock_hitl-0.1.0.tar.gz:
Publisher:
release.yml on fedorello/airlock
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
airlock_hitl-0.1.0.tar.gz -
Subject digest:
859ba37fea751a6f9343f6a46cb2e37731baf57867bc9458ae95d5e2f7395e9c - Sigstore transparency entry: 1952673935
- Sigstore integration time:
-
Permalink:
fedorello/airlock@6b927dd2a0bfaed1b67b6335ff59a50332bc267d -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/fedorello
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@6b927dd2a0bfaed1b67b6335ff59a50332bc267d -
Trigger Event:
push
-
Statement type:
File details
Details for the file airlock_hitl-0.1.0-py3-none-any.whl.
File metadata
- Download URL: airlock_hitl-0.1.0-py3-none-any.whl
- Upload date:
- Size: 29.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
59d9818f7162d625e25e2fd82a0829d6a6a058cecbde3b0d35b6dd159fd76b20
|
|
| MD5 |
9584baf0f183834b0a9784376d515e42
|
|
| BLAKE2b-256 |
3e92090dd4a58e9fec5109551f8095df84ed59d64f369c79c0a41936907b6f33
|
Provenance
The following attestation bundles were made for airlock_hitl-0.1.0-py3-none-any.whl:
Publisher:
release.yml on fedorello/airlock
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
airlock_hitl-0.1.0-py3-none-any.whl -
Subject digest:
59d9818f7162d625e25e2fd82a0829d6a6a058cecbde3b0d35b6dd159fd76b20 - Sigstore transparency entry: 1952674137
- Sigstore integration time:
-
Permalink:
fedorello/airlock@6b927dd2a0bfaed1b67b6335ff59a50332bc267d -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/fedorello
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@6b927dd2a0bfaed1b67b6335ff59a50332bc267d -
Trigger Event:
push
-
Statement type: