Skip to content

feat(gateway): persist and validate agent policy proposal operations #1097

@zredlined

Description

@zredlined

Description

Persist agent-authored proposal metadata and operation payloads, run existing prover checks on submit, and store validation/guidance fields so the developer inbox and agent revision loop have stable state.

Context

Parent: #1062
RFC artifact: https://github.com/NVIDIA/OpenShell/blob/feat/agent-driven-policy-management/rfc/0001-agent-driven-policy-management.md

This is part of the locked Agent-Driven Policy Management MVP. GitHub issues are the development source of truth; Linear is only a roadmap pointer.

For MVP, validation means static security checks the prover supports today, not natural-language intent verification. Sandbox-origin policy operations must be stored as draft chunks for approval; they must not reuse the immediate-apply UpdateConfig path directly.

Definition of Done

  • Draft chunk persistence has columns for source, intent summary, human summary, validation result, rejection guidance, and proposed merge operations.
  • Migrations cover SQLite and Postgres.
  • Sandbox-origin submit with analysis_mode = agent_authored runs existing prover checks against the proposed merged policy.
  • Validation result is stored and returned in GetDraftPolicy.
  • ApproveDraftChunk applies stored PolicyMergeOperation payloads through the existing merge path.
  • RejectDraftChunk persists optional guidance.
  • Agent-authored upserts preserve richer metadata instead of only bumping hit count.
  • Tests cover submit, upsert, validation result, approval merge, and guidance persistence.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:gatewayGateway server and control-plane workarea:policyPolicy engine and policy lifecycle workstate:agent-readyApproved for agent implementation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions