Skip to main content

agentmesh-reputation-gate

Reputation-gated authority resolver for AgentMesh. Implements the AuthorityResolver protocol from microsoft/agent-governance-toolkit#275.

Composes AgentMesh's TrustManager scoring (0-1000) with delegation chains via component-wise monotonic narrowing: effective authority is the intersection of delegated capabilities and trust-tier permissions.

Design proposal: PR #274 (merged into main)

How it works

Agent requests action
  -> delegation.verify()           # existing AgentMesh
  -> trust_manager.get_score()     # existing AgentMesh
  -> resolve_effective_authority()  # THIS PACKAGE
     capability scope = delegation ∩ tier_allowed
     spend limit = min(delegation, tier_cap)
  -> allow / allow_narrowed / deny / audit

Install

pip install agentmesh-reputation-gate

Quick start

from agentmesh_reputation_gate import (
    AuthorityResolver, DelegationInfo, TrustInfo, ActionRequest
)

resolver = AuthorityResolver()

decision = resolver.resolve(
    delegation=DelegationInfo(
        delegation_id="d1",
        delegator_id="alice",
        agent_id="bot-1",
        capabilities=["read:data", "write:reports", "financial:low"],
        spend_limit=500.0,
    ),
    trust=TrustInfo(agent_id="bot-1", score=450),  # Standard tier
    action=ActionRequest(agent_id="bot-1", action="read:data"),
)

print(decision.decision)          # Decision.ALLOW
print(decision.effective_scope)   # ('read:data', 'write:reports')  -- financial:low excluded
print(decision.effective_spend_limit)  # 100.0  -- tier caps at $100
print(decision.trust_tier)        # "standard"

AgentMesh protocol integration

For use with PolicyEngine.set_authority_resolver():

from agentmesh_reputation_gate import AuthorityResolver, AuthorityRequest

resolver = AuthorityResolver()

# Single-arg form matching AgentMesh protocol
request = AuthorityRequest(delegation=d, trust=t, action=a)
decision = resolver.resolve(request)

Both calling conventions produce identical results.

6 Invariants

Every resolution enforces these properties:

  1. No widening -- effective authority never exceeds delegated authority
  2. Trust monotonicity -- lower trust never increases effective authority
  3. Revocation precedence -- revoked delegations always deny
  4. Enforcement freshness -- uses current trust score, not cached
  5. Deterministic resolution -- same inputs produce same output
  6. Lineage bound -- child trust <= parent trust at delegation time

Decision types

Decision Meaning
allow Action permitted as requested
allow_narrowed Action permitted but parameters were capped
deny Action blocked by trust-tier or delegation limits
audit Action permitted but logged for review

Default tier map

Tier Score Capabilities Spend cap
Untrusted 0-199 read:own $0
Limited 200-399 read:*, write:own $10
Standard 400-599 read:*, write:shared, execute:bounded $100
Trusted 600-799 Above + financial:low, admin:observability $1,000
Privileged 800-1000 Above + admin:policy, admin:identity, financial:high Delegation limit

Custom tiers: pass your own list[TierDefinition] to AuthorityResolver(tiers=...).

Capability matching

  • read:data -- exact match only
  • read:* -- single-level wildcard (covers read:data, not read:data:sensitive)
  • read:** -- recursive wildcard (covers any depth)
  • admin:* does NOT imply read:* (no implicit inheritance)
  • Intersection always produces the narrower bound

Tests

PYTHONPATH=src python3 -m pytest tests/ -v

62 tests covering all 6 invariants, capability matching, tier resolution, wildcard intersection, agent identity checks, lineage bound enforcement, adversarial inputs, and AgentMesh protocol compatibility.

References

License

MIT

Metadata

Release files for agentmesh-reputation-gate 0.2.0

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

Source distribution (sdist)

Source distribution for agentmesh-reputation-gate 0.2.0
File Size Uploaded Provenance
agentmesh_reputation_gate-0.2.0.tar.gz 13.8 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for agentmesh-reputation-gate 0.2.0
File Interpreter ABI Platform
agentmesh_reputation_gate-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 25.3 kB

Release files / agentmesh_reputation_gate-0.2.0.tar.gz

Download URL agentmesh_reputation_gate-0.2.0.tar.gz
Size 13.8 kB
Tags Source
SHA-256 checksum
How to use checksums
dec5fb86e86513de9ac4942fa21680a8910b7894d4b32db4b53a8b5a9aa3e5d7
BLAKE2b-256 checksum
How to use checksums
715e832ff52e448f185e6329c9c25b5d03c1c6c59e252e00731e5bc50a5b7428
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.6

Release files / agentmesh_reputation_gate-0.2.0-py3-none-any.whl

Download URL agentmesh_reputation_gate-0.2.0-py3-none-any.whl
Size 11.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
530c1233d07b74a4fe7b0b78f2964b162b071d890bb58f76892f4f8fa7cf16d5
BLAKE2b-256 checksum
How to use checksums
20c815bccbe4b5121ce8002195ff823e7bd7da38583d16ea0f4fdd18a836a233
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.6

Security for agentmesh-reputation-gate 0.2.0

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.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files No provenance

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