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:
- No widening -- effective authority never exceeds delegated authority
- Trust monotonicity -- lower trust never increases effective authority
- Revocation precedence -- revoked delegations always deny
- Enforcement freshness -- uses current trust score, not cached
- Deterministic resolution -- same inputs produce same output
- 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 onlyread:*-- single-level wildcard (coversread:data, notread:data:sensitive)read:**-- recursive wildcard (covers any depth)admin:*does NOT implyread:*(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
- Reputation-Gated Authority ADR (merged PR #274)
- AuthorityResolver interface (issue #275)
- Agent Passport System -- source implementation
- Monotonic Narrowing paper
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)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| agentmesh_reputation_gate-0.2.0.tar.gz | 13.8 kB | Without provenance | Details for agentmesh_reputation_gate-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| agentmesh_reputation_gate-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for agentmesh_reputation_gate-0.2.0-py3-none-any.whl |
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.
To learn more about protecting yourself from malicious actors, visit our package security documentation.