Skip to content

Trust Layer — JWS, Auth, Audit #14

@ggondim

Description

@ggondim

Summary

Implement the optional trust layer that upgrades A2H interactions from lightweight to auditable mode: JWS signing, strong authentication, audit logging, and replay protection.

Tasks

JWS Signing

  • Sign A2H intents: bind intent → context → timestamp into a JWS
  • Sign responses: bind consent/response → intent → timestamp
  • Key management: generate and rotate signing keys
  • Verification endpoint: validate evidence chain

Strong Authentication

  • WebAuthn/Passkey integration for form-based A2H (method 3)
  • OTP fallback (TOTP, SMS)
  • Authentication challenge flow: form presents auth step before allowing response
  • User identity binding: link channel identity to authenticated identity

Audit Logging

  • Structured audit log for all A2H interactions:
    • Intent sent, intent rendered, response received, evidence signed
    • Timestamps, actor IDs, channel metadata
  • Audit log storage via StorageAdapter extension (new collection/table)
  • Audit log query API (GET /api/audit)

Replay Protection

  • Idempotency keys on intents
  • Timestamp validation (reject stale intents)
  • Nonce binding
  • Single-use approval links (mark as consumed after first response)

Acceptance Criteria

  • When trust layer is active, A2H forms require authentication before submission
  • All A2H interactions produce verifiable JWS evidence
  • Audit log records the full decision path: intent → auth → consent → evidence
  • Replay attacks are rejected (expired timestamps, reused nonces, consumed links)
  • When trust layer is off, none of this code runs (zero overhead)

Dependencies

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions