MCPcopy Create free account
hub / github.com/MetapriseAI/OrgKernel / ChallengeResponse

Class ChallengeResponse

src/orgkernel/schemas/agent_identity.py:387–418  ·  view source on GitHub ↗

Response to a challenge — agent signs the nonce with its private key. The verifier checks: 1. challenge_id matches the request 2. agent_id matches 3. Signature verifies against the agent's public key in the certificate

Source from the content-addressed store, hash-verified

385
386
387class ChallengeResponse(BaseModel):
388 """
389 Response to a challenge — agent signs the nonce with its private key.
390
391 The verifier checks:
392 1. challenge_id matches the request
393 2. agent_id matches
394 3. Signature verifies against the agent's public key in the certificate
395 """
396 challenge_id: str = Field(
397 description="ID of the challenge being responded to.",
398 )
399 agent_id: str
400 signature: str = Field(
401 description="Ed25519 signature over nonce using agent's private key.",
402 )
403 public_key: str = Field(
404 description="Ed25519 public key (for verification without DB lookup).",
405 )
406 certificate_id: str = Field(
407 description="Certificate ID (agent_id) being used.",
408 )
409 issued_at: datetime = Field(default_factory=_now_utc)
410
411 @field_validator("signature")
412 @classmethod
413 def _validate_signature(cls, v: str) -> str:
414 if not _B64URL_SIG_RE.match(v):
415 raise ValueError(
416 "signature must be a 86-88 char Base64url Ed25519 signature (64 bytes)."
417 )
418 return v
419
420
421class ChallengeVerificationResult(BaseModel):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected