[Hackathon] vladimirputkov: verified_registry — signature-verified registration with typed rejections and a Sybil scenario#67
Open
VladimirPutkov wants to merge 1 commit into
Conversation
…nd Sybil scenario Add a VerifiedRegistry plugin that gates registration through the identity layer — a card is admitted only when its metadata carries a valid signature by the card's own agent_id over canonical bytes. Rejections carry typed reasons (missing_signature, signer_mismatch, bad_signature). Includes a 7-agent adversarial scenario (3 honest + 3 Sybil attackers + 1 auditor), 4 trace validators, Hypothesis property tests for completeness and soundness, and full E2E + determinism tests. Layer: registry Plugin: registry/verified Scenario: registry_integrity
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
[Hackathon] vladimirputkov: verified_registry — signature-verified registration with typed rejections and a Sybil scenario
Branch:
hackathon/vladimirputkov-registry-integrity· Base:main· Layer: registry (one-layer scope)Motivation
Problem 06 and merged PR #24 made the registry distributed and partition-honest — discovery
converges via gossip instead of pretending a shared dict is a network. But both the default
in_memoryregistry and the gossip registry share one trust model:register(card)believesanyone. Any agent can register an
AgentCardcarrying another agent'sagent_id— silentlyoverwriting the victim's card and poisoning every subsequent
lookup— or advertise capabilitiesit never proved it holds. The identity layer already ships two signing plugins (
did_key,ed25519_rotating), yet no registration ever consults them. Thedocs/layers/registry.mdwishlist covers discovery mechanics; registration authenticity is untouched by any open or
merged PR.
Design
Plugin —
registry/verified.py(registry: verified). A drop-inRegistryimplementationthat routes registration through the identity layer. A card is admitted only when its metadata
carries a signature, by the card's own
agent_id, over the card's canonical bytes(
agent_id,name, order-independentcapabilities,endpoint; metadata excluded — thesignature rides there). Rejections raise
RegistrationRejectedErrorwith a typed reason:missing_signatureagent_idsigner_mismatchbad_signatureVerification is delegated to whatever
Identityplugin is configured — the registry implementsno cryptography.
sign_cardpasseskey_id/signed_atthrough when present, soed25519_rotatingcomposes unchanged. Rejected registrations mutate nothing: no store, nosubscriber notification. Registered as
("registry", "verified")innest_core/plugins.py,exactly like
gossip.Scenario —
scenarios/registry_integrity.yaml(7 agents, seed 42, no failures). Three honestregistrants sign and register their own cards; three Sybil agents attempt the three attacks a
registration gate must refuse — impersonate (victim's id, attacker's key), unsigned
(victim's id, no proof), tamper (own card mutated after signing to grant itself the victim's
capability). An auditor then looks up every honest agent's capability and records whether
discovery still resolves to the authentic owner. Every attempt is emitted as a
reg:trace linewith actor, claimed id, attack kind, verdict, and typed reason.
Adversarial validators —
VALIDATORS["registry_integrity"](4).registry_unauthenticated_rejected(every adversarial attempt rejected; fails vacuous traces),registry_honest_admitted(anti-deny-everything guard),registry_rejection_reasons(eachattack rejected with the right typed reason, not just rejected), and
registry_authentic_discovery(no honest agent missing from discovery or resolving to apoisoned card).
Differential proof. The same YAML with one line flipped to
registry: in_memoryrunswithout crashing: all three attacks are accepted,
honest-0's card is overwritten by theimpersonator (
present=1, authentic=0— a poisoned lookup), and the validators fail. Underregistry: verifiedall four pass. Both runs are asserted end-to-end in tests.Tests
identity is admitted and discoverable; soundness — any post-signing mutation of any
signature-covered field is rejected with the expected typed reason and mutates nothing.
isinstance(…, Registry)), all three rejection reasons, thespoofed-signer variant, unknown-signer rejection, rejection-mutates-nothing, subscriber
notification, canonical-bytes order/metadata independence,
key_idpass-through fromed25519_rotating.fail, poisoned-lookup fail, non-vacuousness, no double-counting of
receivecopies, registrydispatch.
verifiedrun passes all validators (with all three attack kinds and allthree typed reasons present in the trace);
in_memoryrun fails them without crashing; sameseed ⇒ byte-identical trace.
Determinism
No wall-clock, no unseeded RNG; per-agent identities derive from fixed string seeds; canonical
card bytes use sorted keys, sorted capabilities, and fixed separators; the auditor's single
audit:pulse is the only scheduled event. Same seed ⇒ byte-identical trace (asserted).Tradeoffs / residuals (deliberate, documented in the plugin docstring)
deregister(agent)carries no authentication material in theRegistryprotocol, so evictionis unauthenticated — fixing that is a protocol change, out of one-layer scope.
identity layer's problem (and
ed25519_rotating's rotation windows compose here unchanged).key_id/signed_atare passed through so a follow-up can add as-of checks like the identityvalidators do.
Reproduce