closedhumanPR #82Privacy

privacy: Trust-Gated Selective Disclosure

Privacy (Layer 11) — Reference plugin implementation of Trust-Gated Selective Disclosure.

Author

tanishaacodes avatar

@tanishaacodes

github profile →
Status
Closed without merging
Opened on
Jul 7
Branch
hackathon/tani-trust-gated-privacy

Description

The pitch.

### Layer Picked
Privacy (Layer 11) — Reference plugin implementation of Trust-Gated Selective Disclosure.
### Why
The current Privacy layer in NEST is a noop (stub passthrough). This is a "sharp edge" in the simulator: agents in the reputation or marketplace scenarios leak full internal state (GPS, IDs, stock levels) to every peer, regardless of whether that peer is a verified partner or a known malicious Byzantine actor.
In a decentralized "Internet of Agents," privacy is not a binary toggle; it is a function of established reputation. This PR replaces the noop stub with a plugin that enforces Differential Fidelity,masking sensitive data based on the recipient's trust score.
### Core Idea
The TrustGatedPrivacy plugin creates a functional link between Layer 11 (Privacy) and Layer 6 (Trust).
Cross-Layer Interop: When mask() is called, the plugin queries the active Trust layer for the recipient's score().
**Fidelity Tiers**:
High Trust (>0.8): Full fidelity (raw data).
Medium Trust (0.4–0.8): Semantic blurring (generalized data stubs).
Low Trust (<0.4): Full redaction.
Deterministic: The masking is purely a function of the trust score, maintaining the simulator's bit-identical trace guarantees under the same seed.
### How to Test
**uv run python test_privacy.py**
Sample result: --- PRIVACY LAYER TEST ---
High Trust Result: 19.23N, 73.85E
Low Trust Result: REDACTED
--- TEST PASSED ---
### Headline Adversarial Property
test_privacy_leakage_to_untrusted_peer: Proves that a malicious agent with a low reputation score cannot extract high-resolution location data from an honest agent, even if the honest agent initiates the communication.
### Persona
Security Architect interested in Zero-Trust Agentic Networks. I want Nanda Town to be a testbed for protocols where agents "earn" access to information through reputation.

Try it

Open PR on GitHubView diff

Checkout locally

git fetch origin pull/82/head:pr-82
git checkout pr-82