predicate-authority
predicate-authority is a deterministic pre-execution authority layer for AI agents.
It binds identity, policy, and runtime evidence so risky actions are authorized
before execution and denied fail-closed when checks do not pass.
Docs: https://www.PredicateSystems.ai/docs Github Repo: https://github.com/PredicateSystems/predicate-authority
Core pieces:
PolicyEnginefor allow/deny + required verification labels,ActionGuardfor pre-actionauthorize/enforce,LocalMandateSignerfor signed short-lived mandates,InMemoryProofLedgerand optionalOpenTelemetryTraceEmitter,- typed integration adapters (including
sdk-pythonmapping helpers), - control-plane client primitives for shipping proof and usage batches to hosted APIs,
- local identity registry primitives (ephemeral task identities + local flush queue).
Quick usage example
from predicate_authority import ActionGuard, InMemoryProofLedger, LocalMandateSigner, PolicyEngine
from predicate_contracts import (
ActionRequest,
ActionSpec,
PolicyEffect,
PolicyRule,
PrincipalRef,
StateEvidence,
VerificationEvidence,
)
guard = ActionGuard(
policy_engine=PolicyEngine(
rules=(
PolicyRule(
name="allow-orders",
effect=PolicyEffect.ALLOW,
principals=("agent:orders",),
actions=("http.post",),
resources=("https://api.vendor.com/orders",),
),
)
),
mandate_signer=LocalMandateSigner(secret_key="replace-with-strong-secret"),
proof_ledger=InMemoryProofLedger(),
)
request = ActionRequest(
principal=PrincipalRef(principal_id="agent:orders", tenant_id="tenant-a"),
action_spec=ActionSpec(
action="http.post",
resource="https://api.vendor.com/orders",
intent="create order",
),
state_evidence=StateEvidence(source="backend", state_hash="sha256:example"),
verification_evidence=VerificationEvidence(),
)
decision = guard.authorize(request)
print("allowed=", decision.allowed, "reason=", decision.reason.value)
Entra compatibility demo (capability-gated OBO)
python examples/delegation/entra_obo_compat_demo.py \
--tenant-id "$ENTRA_TENANT_ID" \
--client-id "$ENTRA_CLIENT_ID" \
--client-secret "$ENTRA_CLIENT_SECRET" \
--scope "${ENTRA_SCOPE:-api://predicate-authority/.default}"
OIDC compatibility demo (capability-gated token exchange)
python examples/delegation/oidc_compat_demo.py \
--issuer "$OIDC_ISSUER" \
--client-id "$OIDC_CLIENT_ID" \
--client-secret "$OIDC_CLIENT_SECRET" \
--audience "$OIDC_AUDIENCE" \
--scope "${OIDC_SCOPE:-authority:check}"
If your provider supports token exchange and you have a subject token:
python examples/delegation/oidc_compat_demo.py \
--issuer "$OIDC_ISSUER" \
--client-id "$OIDC_CLIENT_ID" \
--client-secret "$OIDC_CLIENT_SECRET" \
--audience "$OIDC_AUDIENCE" \
--scope "${OIDC_SCOPE:-authority:check}" \
--subject-token "$OIDC_SUBJECT_TOKEN" \
--supports-token-exchange
Local IdP quick example
from predicate_authority import LocalIdPBridge, LocalIdPBridgeConfig
from predicate_contracts import PrincipalRef, StateEvidence
bridge = LocalIdPBridge(
LocalIdPBridgeConfig(
issuer="http://localhost/predicate-local-idp",
audience="api://predicate-authority",
signing_key="replace-with-strong-secret",
token_ttl_seconds=300,
)
)
token = bridge.exchange_token(
PrincipalRef(principal_id="agent:local", tenant_id="tenant-a"),
StateEvidence(source="backend", state_hash="sha256:local-state"),
)
print(token.provider.value, token.access_token[:24] + "...")
Metadata
Release files for predicate-authority 0.4.9
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 |
|---|---|---|---|---|
| predicate_authority-0.4.9.tar.gz | 37.1 kB | Without provenance | Details for predicate_authority-0.4.9.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| predicate_authority-0.4.9-py3-none-any.whl | Python 3 | none | any | Details for predicate_authority-0.4.9-py3-none-any.whl |
Total release size: 83.8 kB
Security for predicate-authority 0.4.9
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A 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.