agentspm
Agent Security Posture Management (Agent-SPM) blueprint for EU-regulated,
self-hosted environments. agentspm inventories the AI agents an
organization already runs — their identities, credentials, data access and
enforcement-point routing — into a vendor-neutral asset graph with
provenance, evaluates it against an auditable OPA/Rego policy pack
(13 tri-state controls), and renders evidence-grade reports whose findings
map to EU frameworks (NIS2/ZoKB, DORA, AI Act, GDPR, ISO 27001/42001 — every
mapping status: verify until a human with a compliance role confirms it).
Status: public, v0.1 line (pre-1.0 — interfaces may still move). Install:
pip install agentspm· releases carry keyless Sigstore signatures (verification:docs/ARCHITECTURE.md). All examples, fixtures and demo output are synthetic only (example.com/contosodomains, documented synthetic GUIDs) — see the claims rule indocs/LANGUAGE.md. No production data and no real tenant identifiers exist anywhere in this repository or its history (enforced byscripts/identifier_scan.pyin hooks and CI).
The problem
Organizations are deploying AI agents faster than anyone writes down what those agents ARE: which identities they run under, which credentials and data stores they can reach, and which enforcement point governs them. When an auditor (or an incident) asks, the answer today is tribal knowledge. agentspm turns that question into a scanned, evidence-grade report — without touching or enforcing anything.
Works best next to an enforcement point such as ai-governance-gateway (same author): the gateway enforces and emits a signed posture feed; agentspm reads it — together with your IdP — into one asset graph with provenance. Each product stands alone; the pairing is a versioned, sha256-pinned HTTP contract, not a dependency.
What it is NOT
- Posture, not enforcement. It finds, documents and maps — it never blocks, prevents or mutates anything. Runtime guardrails, DLP inspection and routing belong to an enforcement point (such as an LLM governance gateway); agentspm only reads its posture.
- Not an agent framework. It does not build, host or orchestrate agents; it scans the estate of agents you already have.
- Not legal advice and not a compliance verdict. Reports are evidence for
your own assessment;
unknownis reported asunknown, never scored asfail; framework anchors staystatus: verifyuntil confirmed by a person with a compliance role. - No web UI, no SaaS, no multi-tenant mode, no model artifact scanning.
Deployment model and identity providers — read this before a POC
- Self-hosted only. There is no hosted or SaaS offering, and the tool phones home to no one: one CLI, one SQLite file, your infrastructure. That is a design decision for regulated environments, not a missing feature.
- IdP coverage today — said out loud: the only implemented identity
collector is Microsoft Entra ID (read-only, attribute-whitelisted).
The gateway posture collector is IdP-agnostic (versioned HTTP contract).
Other IdPs (Okta, Keycloak, on-prem AD) are a documented extension point
(
docs/INTEGRATION.md, "adding a collector"), not shipped code — if your estate lives in a different IdP, budget for writing a collector before you expect identity posture results. - Discovery coverage today — said out loud: the inventory is built from
what is declared (git manifests, the
agentspm:agenttag in Entra) and what is attested (enforcement-point posture events). agentspm does not discover agents that end users create in vendor SaaS planes (e.g. Copilot Studio, M365 Copilot agents): those traverse no governed route and carry no tag, so they never enter the graph — and report coverage cannot show that gap. An experimentalentra-agent-iddiscovery collector exists (ADR-0006): it enumerates Entra Agent ID objects as discovered nodes, but it is unverified against a live tenant until the SPIKE-0001 checklist passes; discovered nodes enter policy evaluation like any other asset and can surface asunknownfindings, but no control derives a pass or fail from a discovered node alone (dedicated discovered-node controls are deferred to v0.2, ADR-0006 §6), and it structurally cannot see agents created before the Agent ID model. A second experimentalpower-platformcollector (ADR-0007) enumerates Copilot Studio agents per Dataverse environment — the purpose-built Power Platform inventory API is documented as delegated-only (service principals receive 403), so the collector reads thebottable per configured environment instead, and it is likewise unverified against a live tenant until SPIKE-0002 passes. If shadow-AI discovery is your first requirement, readdocs/adr/ADR-0005-end-user-saas-agent-discovery-boundary.mdand the two spike checklists (docs/spikes/) first, or start from your platform's own admin inventory.
Support
Actively developed, solo maintainer — support is best-effort via GitHub Issues; security reports go through the private channel in SECURITY.md (acknowledgement target 72 h). There is no SLA and no commercial support today. For procurement purposes this is internally supported OSS: plan your own operational ownership, the same way you would for any other tool you self-host.
Scope vs. microsoft/agent-governance-toolkit
The nearest OSS neighbor is the Microsoft Agent Governance Toolkit (MIT) — a broader governance toolkit, enforcement-first and aimed at governing agents through their lifecycle: discovery/AgentMesh, OPA/Cedar policy, SPIFFE/DID identity, sandboxing, tamper-evident audit, mappings to EU AI Act/NIST AI RMF/SOC 2.
agentspm is deliberately narrow: a posture/evidence scanner over the existing estate — read-only collectors (Entra ID, Git hosting, gateway posture API), an asset graph with per-attribute provenance and attested-vs-declared precedence, tri-state controls, and an evidence report whose anchors target the EU regulatory set including the Czech ZoKB — all self-hosted with zero infrastructure (one CLI, one SQLite file, no service). If you need lifecycle governance and enforcement, use a toolkit like AGT at the enforcement layer; agentspm is the independent posture reading and audit-evidence layer next to it.
How it works
agentspm pulls your estate from read-only sources into an asset graph,
evaluates it against a pinned OPA policy pack, and renders an evidence-grade
report. Tri-state by design: pass, fail, and unknown (a coverage gap —
never counted as a failure).
How it pairs with the gateway
Each product stands alone (0 cross-imports); the only coupling is the versioned, sha256-pinned posture feed.
Quickstart (synthetic, no network)
Runs the real pipeline against the built-in mock gateway — the output is labeled generated over synthetic fixtures:
uv sync # install (locked); includes the dev group the mock needs
scripts/setup-hooks.sh # MANDATORY for contributors: SEC-D5 pre-commit/pre-push hooks
# 1) OPA engine — the one external binary. Download the exact version this
# repo pins (same version+sha256 the container build enforces):
curl -sLo "$HOME/.local/bin/opa" \
"https://openpolicyagent.org/downloads/v1.21.4/opa_linux_amd64_static"
echo "2ab571f367f293bb19523b76f92f1945bbf245003392c7f392903f95c2b9b630 $HOME/.local/bin/opa" | sha256sum -c -
chmod +x "$HOME/.local/bin/opa"
# 2) evaluate refuses to run an unpinned OPA engine — pin the binary you trust:
export AGENTSPM_OPA_PATH="$HOME/.local/bin/opa"
export AGENTSPM_OPA_SHA256="$(sha256sum "$AGENTSPM_OPA_PATH" | cut -d' ' -f1)"
# 3) report pseudonymizes by default and needs a key location — point it at
# a file; the key is auto-generated on first use (0600):
export AGENTSPM_PSEUDO_KEY_PATH="$PWD/.agentspm-pseudo.key"
uv run agentspm scan --collector mock-gateway # collect -> validate -> merge -> derive
uv run agentspm evaluate # pinned OPA, 13 tri-state controls
uv run agentspm report --format md --out report.md # redacted profile (default)
Not ready to run anything yet? The exact output of this quickstart is committed as docs/examples/sample-redacted-report.md — synthetic fixtures, redacted profile, the real renderer.
Installed via pip install agentspm instead of a checkout? The schemas and
the policy pack ship in the wheel, so evaluate and report run as-is. The
mock-gateway collector additionally needs FastAPI (a test-only dependency
kept out of the runtime): pip install agentspm[demo], then drop the uv run
prefix. Only the contributor hooks and the test suite are repo-only.
Also available: --format json|sarif, agentspm export --encrypt age:<recipient> (requires ≥ 2 recipients), and agentspm doctor as the
deployment preflight. On this synthetic run doctor will report failures
(age recipients, and opa sha256 pin unless you exported the variable above)
and a warning for the unconfigured evidence store: the quickstart configures
neither, and both are export-side requirements. That is the preflight doing its
job, not a broken install — a green doctor is a property of a configured
deployment, not of a fresh clone. To scan your own tenant instead of the mock, follow
docs/INTEGRATION.md.
Documentation
| Document | Content |
|---|---|
| docs/ARCHITECTURE.md | pipeline, components, contracts, invariants, evidence & deployment in a regulated entity, exit/fork strategy |
| docs/INTEGRATION.md | bring your own tenant/IdP: dedicated app registration, exact minimal scopes, doctor, manual-run rules, adding a collector |
| docs/PRIVACY.md | GDPR position: purpose, art. 6(1)(f)/recital 49 with LIA template, minimization, dual-tier retention, art. 30 record, DPIA screening |
| docs/THREAT-MODEL.md | threats T-01..T-17 with mitigations and status |
| docs/CONTROLS.md | generated control reference (13 controls, framework anchors, all verify) |
| docs/LANGUAGE.md | honest-claims rules (lint-enforced) incl. the fail-closed qualification and the synthetic-fixtures claims rule |
| docs/RELEASE-GATE.md | two-stage release gate: quality (binding even privately) and publication |
| docs/GOVERNANCE.md | schema-change process (ADR now, RFC from publication) |
| docs/adr/ | architecture decision records |
Repository layout
schema/v0.1/— JSON Schema 2020-12 contracts (asset graph, findings); shipped inside the wheel.schema/examples/— synthetic examples.policies/v0.1/— OPA/Rego policy pack: 13 tri-state controls,opa testsuites, synthetic fixtures,controls.yamlanchors, pinnedcapabilities.jsonwithout network builtins.src/agentspm/— collectors, validator, graph store/merge/derive, evaluate, reporter (+ redaction), CLI.contracts/gateway/v0.2/— the gateway posture-read OpenAPI contract (owned here, vendored by consumers with a sha256 pin).deploy/— example config + Kubernetes CronJob reference;Containerfile— UBI9-minimal image;scripts/build_release.sh— wheel + SBOM + checksums.scripts/— CI/hook lints (identifier scan, language lint, policy lints).
Development
uv sync # install (locked)
scripts/setup-hooks.sh # MANDATORY: installs pre-commit/pre-push hooks (SEC-D5)
uv run pytest # tests
uv run ruff check . # lint
uv run mypy src/ # types (strict)
License
- Code and the OPA policy pack: Apache-2.0.
- Documentation and the compliance framework mappings (
docs/, the NIS2/DORA/ZoKB/AI Act anchor tables indocs/CONTROLS.md): CC-BY-4.0. If you reuse the mappings, attribute "the agentspm maintainers" and keep thestatus: verifyqualifiers — the attribution travels with the caveat, not instead of it. The mappings are a reading aid, not legal advice;status: verifymeans exactly that.
Confirmed at the publication gate (docs/RELEASE-GATE.md, item P8,
2026-11-11).
Metadata
Release files for agentspm 0.1.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| agentspm-0.1.8.tar.gz | 440.3 kB | With provenance | Details for agentspm-0.1.8.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| agentspm-0.1.8-py3-none-any.whl | Python 3 | none | any | Details for agentspm-0.1.8-py3-none-any.whl |
Total release size: 610.4 kB
Release files / agentspm-0.1.8.tar.gz
| Download URL | agentspm-0.1.8.tar.gz |
|---|---|
| Size | 440.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0d5a2f6396e80a09f3ddc460d20aa8e076968ba2c481b8d0f5c35389a2d1cdbf
|
|
BLAKE2b-256 checksum How to use checksums |
46a814b692486b8995c207ae2f5cd39df46f709f21e3d2f2a83d2d8758643c5c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 28, 2026.
Transparency logRelease files / agentspm-0.1.8-py3-none-any.whl
| Download URL | agentspm-0.1.8-py3-none-any.whl |
|---|---|
| Size | 170.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
693d1e3d94dc3cdb5945b70869ba9f17cdaca81dbab7f474e4ed9db340522379
|
|
BLAKE2b-256 checksum How to use checksums |
86e25c9fb78dc73f534ca0e919533280408a9c791bd68f97379c231247fb59f3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 28, 2026.
Transparency logSecurity for agentspm 0.1.8
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for agentspm-0.1.8.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 28, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.