Reputation-gated authority resolver for AgentMesh. Composes trust scoring with delegation chains via monotonic narrowing.
Project description
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file agentmesh_reputation_gate-0.2.0.tar.gz.
File metadata
- Download URL: agentmesh_reputation_gate-0.2.0.tar.gz
- Upload date:
- Size: 13.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dec5fb86e86513de9ac4942fa21680a8910b7894d4b32db4b53a8b5a9aa3e5d7
|
|
| MD5 |
6167bcc4a3ac96a1287e9bf4dd423f49
|
|
| BLAKE2b-256 |
715e832ff52e448f185e6329c9c25b5d03c1c6c59e252e00731e5bc50a5b7428
|
File details
Details for the file agentmesh_reputation_gate-0.2.0-py3-none-any.whl.
File metadata
- Download URL: agentmesh_reputation_gate-0.2.0-py3-none-any.whl
- Upload date:
- Size: 11.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
530c1233d07b74a4fe7b0b78f2964b162b071d890bb58f76892f4f8fa7cf16d5
|
|
| MD5 |
b42ae64c958b2c76d38196018ff34d49
|
|
| BLAKE2b-256 |
20c815bccbe4b5121ce8002195ff823e7bd7da38583d16ea0f4fdd18a836a233
|