Skip to content

chore: security, performance, and dependency sweep#411

Merged
jithinraj merged 6 commits intomainfrom
chore/security-sweep
Feb 23, 2026
Merged

chore: security, performance, and dependency sweep#411
jithinraj merged 6 commits intomainfrom
chore/security-sweep

Conversation

@jithinraj
Copy link
Member

Summary

  • Update tests/perf/baseline-results.json with measured Zod 4 benchmarks (parseReceiptClaims commerce ~388K ops/sec, attestation ~792K ops/sec)
  • Create docs/security/OWASP-ASI-MAPPING.md mapping all 10 OWASP Top 10 for Agentic Applications risks (ASI-01 through ASI-10) to specific PEAC mitigations with test file citations
  • Verify audit-gate allowlist freshness: 3 active entries, all within 30-day prod ceiling

OWASP ASI Coverage

All 10 risks mapped to specific mitigations and test files:

Risk Status Key Mitigation
ASI-01: Agentic Prompt Injection Covered Structured JSON-RPC inputs, Zod schema validation
ASI-02: Unsafe Tool/Function Execution Covered Deterministic functions, no shell/fs/network access
ASI-03: Excessive Permissions Covered Capability-based tool exposure (DD-52)
ASI-04: Insufficient Tool/Function Access Controls Covered Static policy configuration (DD-53)
ASI-05: Improper Multi-Agent Orchestration Covered Cryptographic receipts with workflow context
ASI-06: Unreliable Output Handling Covered Structured output schemas (DD-54)
ASI-07: Vulnerable Third-Party Agents Covered Ed25519 signatures, SDK pinning, audit-gate
ASI-08: Lack of Agentic System Monitoring Covered Telemetry hooks, structured verification reports
ASI-09: Inadequate Failure Handling Covered Fail-closed design, typed error taxonomy
ASI-10: Uncontrolled Agentic Autonomy Covered Purpose declaration, obligations extensions

Performance Baselines (Zod 4)

Benchmark ops/sec
validateKernelConstraints 1,079,525
assertJsonSafe 468,878
parseReceiptClaims (commerce) 388,247
parseReceiptClaims (attestation) 792,079
toCoreClaims (commerce) 11,822,657
toCoreClaims (attestation) 27,280,934

Test plan

  • Existing tests pass unchanged
  • pnpm audit passes (zero high/critical unallowlisted)
  • audit-gate.mjs passes with fresh allowlist entries
  • OWASP mapping document cites correct test file paths

Migrate all 9 packages from Zod 3.22.x to Zod 4.3.6. This is a
breaking change for downstream TypeScript consumers who compile
against exported @peac/schema types (z.infer<> types are not
assignment-compatible across Zod majors).

Schema changes:
- z.record() single-arg form removed in Zod 4: add explicit
  z.string() key schema in 5 locations (schema, control, mcp-server)
- .default({}) on object schemas requires output-type-compatible
  values in Zod 4: use .prefault({}) for input-type defaults (policy.ts)
- ZodError.errors alias removed: use .issues in test assertions
- issue.path typed as PropertyKey[] (was (string | number)[]): add
  casts at 2 call sites (protocol/issue.ts, cli/validators.ts)

No behavioral changes to schema validation, receipt issuance, or
verification. All 4138 tests pass across 167 test files.

Workspace enforcement:
- pnpm.overrides forces zod@^4.3.6 across all workspace packages
- Prevents mixed Zod 3/4 which causes runtime TypeError
- Update performance baselines with Zod 4 benchmarks (measured)
- Create OWASP Top 10 for Agentic Applications alignment mapping (ASI-01 through ASI-10)
- Verify audit-gate allowlist freshness (3 active entries, all within 30-day ceiling)
- All 10 OWASP ASI risks mapped to specific PEAC mitigations with test file citations
@jithinraj jithinraj changed the base branch from feat/zod4-schema to main February 22, 2026 20:59
@jithinraj jithinraj changed the title chore: security, performance, and dependency sweep (DD-118) chore: security, performance, and dependency sweep Feb 23, 2026
@jithinraj jithinraj merged commit ab51f06 into main Feb 23, 2026
8 checks passed
@jithinraj jithinraj deleted the chore/security-sweep branch February 24, 2026 21:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant