Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

ARDGuard

PyPI Python compatibility Python License

ARDGuard adds an eligibility boundary between agentic resource discovery and final use.

It consumes ranked discovery results, evaluates independently established task-specific capability, evidence, and authority observations, and selects the highest-ranked eligible resource or returns an explicit defer, abstain, or error decision. It never installs or invokes the selected resource.

Status: 0.1.0b1 Beta 1. The deterministic core and static observation path are supported. The sandboxed PyPI and Sigstore command provider is experimental. See the support matrix before production use.

python -m pip install ardguard==0.1.0b1
ardguard demo
ARDGuard offline demo (illustrative)
rank 1: relevant but capability-ineligible
rank 2: eligible
top-ranked-only validation: ABSTAIN
ARDGuard: SELECT urn:air:example.org:tool:rank-two
reason: selection.fallback_to_lower_ranked_eligible
invocation: NOT PERFORMED

Relevance answers which resource looks useful. Eligibility answers which resource may this agent use for this task.

Put it after discovery

ARD-compatible discovery backend
              |
              v
       ranked candidates
              |
              v
          ARDGuard
  facts + policy + fallback
              |
              v
 SELECT / DEFER / ABSTAIN / ERROR
              |
              v
      caller owns invocation

ARDGuard does not replace ARD, hf-discover, relevance ranking, Sigstore, OAuth, or Kubernetes RBAC. It makes the consumer's final eligibility decision explicit.

JSON in, decision JSON out

Prepare a task contract, policy, and observations, then evaluate any supported ARD SearchResponse:

hf-discover search "read customer records" --json > discovery.json

ardguard evaluate \
  --adapter hf-discover \
  --discovery-response discovery.json \
  --task task.json \
  --policy policy.json \
  --facts facts.json \
  --output decision.json

ardguard explain decision.json

Example decision:

{
  "outcome": "SELECT",
  "reason": "selection.fallback_to_lower_ranked_eligible",
  "selected_candidate_id": "urn:air:example.org:tool:rank-two",
  "selected_rank": 2
}

The actual decision document also contains every candidate verdict, stable reason codes, provider identities, preserved backend scores, and a deterministic body hash.

Python integration

from ardguard import FactSet, Policy, TaskContract, evaluate
from ardguard.adapters import parse_search_response

candidates = parse_search_response(discovery_response)
decision = evaluate(
    candidates=candidates,
    task=TaskContract.from_mapping(task_document),
    policy=Policy.from_mapping(policy_document),
    facts=FactSet.from_mapping(fact_document),
)

if decision.outcome.value == "SELECT":
    # The caller may now decide whether and how to invoke the resource.
    print(decision.selected_candidate_id)

Why fallback matters

A top-ranked-only validator can reject an ineligible first result, but it also abandons the task when a lower-ranked candidate is eligible. ARDGuard evaluates the configured candidate set, preserves the backend's rank among eligible candidates, and returns the highest-ranked eligible candidate. It does not manufacture or reinterpret relevance scores.

Contracts, not self-asserted eligibility

Public callers supply observations, not eligible: true. ARDGuard derives candidate verdicts from versioned contracts:

  • TaskContract states required operations, evidence, and authority limits.
  • FactSet binds typed observations to candidate and provider identities.
  • Policy controls required checks, uncertainty, and fallback.
  • Decision reports SELECT, DEFER, ABSTAIN, or ERROR with stable reasons.

Missing facts, unavailable verifiers, and operational errors fail closed. An operational verifier failure is never reported as an invalid signature. Authentic evidence for artifact A never makes candidate B eligible.

Commands

Command Purpose
ardguard demo Run the deterministic offline fallback example.
ardguard doctor Report package, schema, adapter, and provider readiness.
ardguard validate Validate task, fact, policy, decision, ARD, or hf-discover JSON.
ardguard evaluate Produce a deterministic decision without invocation.
ardguard explain Validate the decision hash and explain its reason.
ardguard support Print the tested support matrix.
ardguard adapters Print exact adapter compatibility records.

Documentation

Examples

Development

python3.12 -m venv .venv
.venv/bin/pip install -e '.[dev]'
.venv/bin/pytest
.venv/bin/ruff check .
.venv/bin/mypy src/ardguard

Small compatibility fixtures, provider implementations, reason-code improvements, and reproducible interoperability reports are welcome. Read CONTRIBUTING.md and SECURITY.md first.

License

Apache License 2.0. See LICENSE and NOTICE.

Release files for ardguard 0.1.0b1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ardguard 0.1.0b1
File Size Uploaded
ardguard-0.1.0b1.tar.gz 40.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ardguard 0.1.0b1
File Interpreter ABI Platform
ardguard-0.1.0b1-py3-none-any.whl Python 3 none any Details

Total release size: 77.4 kB

Release files / ardguard-0.1.0b1.tar.gz

Download URL ardguard-0.1.0b1.tar.gz
Size 40.3 kB
Tags Source
SHA-256 checksum
How to use checksums
ea3773a4526f22fa303e16d4f56b0a6c75b782d827a14b4338dc04aa628eb50d
BLAKE2b-256 checksum
How to use checksums
c2c18e3740b61d0dc50a56fa19d60f79dbbd5b893ae441a95196836b0139b036
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 10, 2026.

Transparency log

Release files / ardguard-0.1.0b1-py3-none-any.whl

Download URL ardguard-0.1.0b1-py3-none-any.whl
Size 37.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5510609459a8a1f587f0622e8c510a879d5b3cbac3ddaf7ceb9697c59d343a79
BLAKE2b-256 checksum
How to use checksums
afe2d897dda548017eedf1df9ccf885ec915343d342532f41e46978a6ee1bf76
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 10, 2026.

Transparency log
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page