admission-gate
A zero-dependency, deterministic admission security kernel and cryptographic audit logging engine for autonomous CLI agents.
When autonomous scripts or LLMs execute commands in a subshell, developers face two extremes: fully autonomous execution that risks destructive operations, or prompt fatigue from micro-approving benign steps. admission-gate sits directly between the agent and your shell:
- Deterministic Security Kernel: Enforces sandbox jails, blocks hazardous tokens, and canonicalizes paths (
os.path.realpath) across all command arguments. - Metacharacter & Environment Variable Hardening: Neutralizes command chaining evasions, redirection breakouts, indirect subshells (
$(...), backticks,<(...)), and unexpanded environment variable injection ($VAR,${VAR},%VAR%). - Risk-Tier Auto-Classification: Automatically infers risk based on command binaries, flags (e.g.
sed -i), and redirection operators, ratcheting upward if an agent attempts to under-report risk. - Sliding-Window Rate Limiting & Burst Control: Enforces maximum requests per minute, mandatory quiescent cooldown periods after destructive actions (Tier 3), and burst escalation.
- Interactive & Non-Interactive (
--verify-only) Modes: Halts for operator authorization ([y/N]) on interactive terminals or runs headless with structured outputs in CI/automation. - Cryptographic Audit Trail & Forensic Tools: Appends SHA-256 hash-chained JSONL logs, verifiable via
verify-auditand queryable viaquery-audit. - Native Model Context Protocol (MCP): Exposes
admission-gate-mcpfor direct integration into Claude Desktop, Cursor, and Cline.
Requires Python 3.8+ with zero third-party dependencies.
Installation
pip install --upgrade admission-gate
Configuration (admission_gate.toml)
Place admission_gate.toml in your working directory or provide --config <path>:
[policy]
blocked_patterns = [
"rm -rf /",
":(){ :|:f };:",
"/dev/sd",
"> /dev/null",
"mkfs",
]
require_confirm = true
[filesystem]
allowed_roots = [
"./workspace",
"./scratch",
]
protected_paths = [
"/etc",
"/boot",
"/sys",
"/dev",
"/proc",
"C:\\Windows",
"C:\\Windows\\System32",
]
logging]
log_file = "audit_log.jsonl"
[rate_limit]
enabled = true
max_requests_per_minute = 30
burst_threshold = 10
tier3_cooldown_seconds = 3.0
Risk-Tier Auto-Classification
The gate calculates an effective risk tier for every proposal. The engine only ratchets upward:
Tier 1 (Read-Only / Inspection): ls, cat, head, tail, grep, find, stat, diff, wc, file.
Tier 2 (Mutating / State Modification): touch, mkdir, cp, ggit add, python, node, or any command containing redirection (>, >>). **Tier 3 (Destructive / Administrative)**: rm, mv, chmod, chown, dd, truncate, kill, sed -i, mkfs, shred`.
Command Line Tools
1. admission-gate (Core Gatekeeper)
# Interactive execution
some_proposal_stream | admission-gate
# Headless / Dry-Run verification in CI
some_proposal_stream | admission-gate --verify-only
2. verify-audit (Cryptographic Verification)
Matches all prev-hash chains and validates tamper-resistance:
verify-audit audit_log.jsonl
3. query-audit (Forensic Query & Replay)
Filter historical records or simulate past proposals against updated policies:
# Filter by risk tier or status
query-audit --tier 3
query-audit --status blocked
# Filter by time window
query-audit --since 15mquery-audit --until 5m
# Replay past actions against current admission_gate.toml rules
query-audit --action-id step_1 --replay
4. admission-gate-mcp (MCP Adapter)
{
"mcpServers": {
"admission_gate": {
"command": "admission-gate-mcp",
"args": []
}
}
}
Running the Test Suite
PYTHONPATG=src python3 -m unittest discover -s tests
License
[MIT)(LICENSE)
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 admission_gate-0.3.0.tar.gz.
File metadata
- Download URL: admission_gate-0.3.0.tar.gz
- Upload date:
- Size: 20.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
45a00c015e1d5e1adaf8841d8138c0f4b80c0872d6d44df1131212342cd4da13
|
|
| MD5 |
de87d9172ec9aaeafb3b272175cd649b
|
|
| BLAKE2b-256 |
24aa1d082fb0afb2c12f617dbdbcb9b21f489795ced22ac6ac3835a654b61598
|
Provenance
The following attestation bundles were made for admission_gate-0.3.0.tar.gz:
Publisher:
publish.yml on ak-skwaa-mahawk/admission-gate
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
admission_gate-0.3.0.tar.gz -
Subject digest:
45a00c015e1d5e1adaf8841d8138c0f4b80c0872d6d44df1131212342cd4da13 - Sigstore transparency entry: 2754042970
- Sigstore integration time:
-
Permalink:
ak-skwaa-mahawk/admission-gate@4508a0029283e26fe4b7af866afeee7882f1148d -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/ak-skwaa-mahawk
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@4508a0029283e26fe4b7af866afeee7882f1148d -
Trigger Event:
push
-
Statement type:
File details
Details for the file admission_gate-0.3.0-py3-none-any.whl.
File metadata
- Download URL: admission_gate-0.3.0-py3-none-any.whl
- Upload date:
- Size: 17.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c1fa6e87820196b99cdd61b8dffed18c2794607c589bdc49b4d36704276bd733
|
|
| MD5 |
629ad86ff71c48104b4c433983b36b97
|
|
| BLAKE2b-256 |
293db47dc430a2c6472d2bf414de9aaabb14af7e0e4fbd8a98a430d6fac01141
|
Provenance
The following attestation bundles were made for admission_gate-0.3.0-py3-none-any.whl:
Publisher:
publish.yml on ak-skwaa-mahawk/admission-gate
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
admission_gate-0.3.0-py3-none-any.whl -
Subject digest:
c1fa6e87820196b99cdd61b8dffed18c2794607c589bdc49b4d36704276bd733 - Sigstore transparency entry: 2754042984
- Sigstore integration time:
-
Permalink:
ak-skwaa-mahawk/admission-gate@4508a0029283e26fe4b7af866afeee7882f1148d -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/ak-skwaa-mahawk
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@4508a0029283e26fe4b7af866afeee7882f1148d -
Trigger Event:
push
-
Statement type: