ARCHMAGE
saeng-il ai [ research | development | integration ]
Deterministic pre-execution control for coding-agent actions.
Current release:
v2.0.0. Python distributions are published asarchmage-ai; the portable Agent Plugin is attached separately to the GitHub release.
ARCHMAGE evaluates a proposed tool action before an adapter dispatches it. The runtime converts the proposal into a stable digest, runs deterministic policy evaluators, and emits one typed decision:
ALLOW · ALLOW_WITH_OBLIGATIONS · REPAIR · DENY · ESCALATE
It is designed for coding-agent file writes, command proposals, protected-policy changes, declared scope, artifact lineage, identity, and evidence obligations.
Two-minute example
from dataclasses import replace
from archmage import (
ActionProposal,
ActorIdentity,
PolicyContext,
create_default_policy_decision_point,
)
pdp = create_default_policy_decision_point()
context = PolicyContext(
workspace="/workspace/project",
environment="local",
audit_logger_configured=True,
)
proposal = ActionProposal(
task_id="task-42",
actor=ActorIdentity(actor_id="coding-agent", actor_type="agent"),
operation="write_file",
tool="write_to_file",
arguments={"TargetFile": "../outside.py"},
target_paths=["../outside.py"],
requested_side_effects=[],
repository_revision="0123456789abcdef0123456789abcdef01234567",
environment="local",
)
blocked = pdp.evaluate(proposal, context)
print(blocked.decision) # VerdictDecision.DENY
narrowed = replace(
proposal,
arguments={"TargetFile": "src/feature.py"},
target_paths=["src/feature.py"],
)
allowed = pdp.evaluate(narrowed, context)
print(allowed.decision) # VerdictDecision.ALLOW
The adapter or executor must refuse dispatch unless the returned decision permits it. ARCHMAGE does not independently intercept arbitrary operating-system activity.
Install and verify
Install the signed package release:
python -m pip install archmage-ai
For development from a reviewed checkout:
python -m pip install --editable ".[dev]"
python -m pytest
Release wheels and source distributions are built in GitHub Actions, accompanied by SHA-256 checksums, an SPDX SBOM, and GitHub artifact attestations. Verification instructions are in the supply-chain guide.
Agent Plugin
ARCHMAGE also ships a separate, self-contained Agent Plugins 1.0.0 ZIP. The
plugin is an interoperability and distribution adapter: its Agent Skill tells a
compatible host when to invoke the bundled MCP tools, while those tools route
every decision through the same Python PolicyEnforcementPoint used by native
integrations.
The ZIP is deliberately separate from the wheel and source distribution. It is validated against vendored Agent Plugins schemas, smoke-tested directly from an extracted archive, and never submitted to PyPI or Python metadata validation. See the Agent Plugin guide for the trust boundary and installation sequence.
What is included
- Eleven deterministic core evaluators with fail-closed aggregation.
- A generic tool-call adapter with explicit identity, workspace, and immutable revision requirements and canonical JSON payload validation.
- A reference Antigravity adapter.
- Digest-bound, verifier-backed, single-use approval records for destructive and shell-command obligations.
- Contract evaluators for interface depth and contract-first Python changes.
- Reproducible gold-case, repair-loop, policy-drift, and latency benchmarks.
- An Apache-2.0 licensed skill and doctrine bundle.
- A portable Agent Plugins 1.0.0 edge adapter with durable JSONL audit records.
Validated release-candidate benchmarks
The latest hosted candidate evidence is produced by the revision-bound CI workflow. Every JSON artifact records the exact commit, case catalog, Python version, and runner platform. Signed release artifacts will supersede this release-candidate snapshot.
| Suite | Result | Scope |
|---|---|---|
| Gold-case compliance | 13/13 exact; 0 false positives; 0 false negatives | Fixed catalog, 11 default evaluators |
| Repair loop | 2/2 compliant after one retry | Fixed machine-readable repairs |
| Indirect-instruction subset | 2/2 dangerous proposals denied | Tool proposals attributed to untrusted repository text |
| Full-PDP overhead | 0.348455 ms p95; 3,132.472 evaluations/s | 5,000 iterations on hosted Linux, CPython 3.13.14 |
These are deterministic proposal-level results from one recorded environment, not claims of universal agent safety or platform-wide performance. See the benchmark guide and security claims policy.
Security boundary
ARCHMAGE is a policy decision and enforcement library, not a sandbox, firewall, credential vault, malware scanner, or complete prompt-injection defense. Its guarantees depend on every relevant tool call passing through a correctly wired adapter, on the host preventing bypass around that adapter, and on the host authenticating any approval record before its verifier accepts it.
Read limitations before integrating it with privileged
tools. Report suspected vulnerabilities through the private route documented in
SECURITY.md once that release-gate policy is approved.
Documentation
- Published documentation
- Quickstart
- Core concepts
- Policy model
- Architecture
- Agent Plugin
- Adapters
- Writing custom evaluators
- Benchmarks
- Security claims
- Threat model
- Limitations
- Supply-chain verification
Contributing
Contribution access is approval-only. Start with a proposal and read CONTRIBUTING.md and ARCHMAGE_RANKS.md. Security-sensitive changes require private disclosure and tests that demonstrate both the blocked path and the expected compliant path.
License
Apache License 2.0. See 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 archmage_ai-2.0.0.tar.gz.
File metadata
- Download URL: archmage_ai-2.0.0.tar.gz
- Upload date:
- Size: 67.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ebf96877651511403daf963653e3a23394923993efc56d636bc7f7ebff69a3c6
|
|
| MD5 |
1cd8927552a76a87a420996646fed12a
|
|
| BLAKE2b-256 |
45649ecbe898dba933de67cb84d814effc7d3bda5d52837b1904f2fe7e7cbd0d
|
Provenance
The following attestation bundles were made for archmage_ai-2.0.0.tar.gz:
Publisher:
release.yml on YXZYSME/archmage
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
archmage_ai-2.0.0.tar.gz -
Subject digest:
ebf96877651511403daf963653e3a23394923993efc56d636bc7f7ebff69a3c6 - Sigstore transparency entry: 2584947746
- Sigstore integration time:
-
Permalink:
YXZYSME/archmage@0ce6633f420aee75ee2a8140680d03b6cdfa95eb -
Branch / Tag:
refs/tags/v2.0.0 - Owner: https://github.com/YXZYSME
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@0ce6633f420aee75ee2a8140680d03b6cdfa95eb -
Trigger Event:
release
-
Statement type:
File details
Details for the file archmage_ai-2.0.0-py3-none-any.whl.
File metadata
- Download URL: archmage_ai-2.0.0-py3-none-any.whl
- Upload date:
- Size: 53.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8f65998a624f0fd982627ca700ef536a0c2ef051714c7bd87901e6ee100747cc
|
|
| MD5 |
6ffa0abf88c66d2fa3d81488aac4d948
|
|
| BLAKE2b-256 |
5a846b2c2ef11f649f0f42e059e4f5347199560b870cd76c0ef39c379c965d35
|
Provenance
The following attestation bundles were made for archmage_ai-2.0.0-py3-none-any.whl:
Publisher:
release.yml on YXZYSME/archmage
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
archmage_ai-2.0.0-py3-none-any.whl -
Subject digest:
8f65998a624f0fd982627ca700ef536a0c2ef051714c7bd87901e6ee100747cc - Sigstore transparency entry: 2584947838
- Sigstore integration time:
-
Permalink:
YXZYSME/archmage@0ce6633f420aee75ee2a8140680d03b6cdfa95eb -
Branch / Tag:
refs/tags/v2.0.0 - Owner: https://github.com/YXZYSME
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@0ce6633f420aee75ee2a8140680d03b6cdfa95eb -
Trigger Event:
release
-
Statement type: