Repository navigation
OpenShell Agent-Driven Policy Management #1062
Description
Activity
- addedarea:policyPolicy engine and policy lifecycle workPolicy engine and policy lifecycle work
on Apr 29, 2026 - added a parent issue
on Apr 29, 2026 - changed the title
[-]OpenShell Agent-Driven Policy Management (copy)[/-][+]OpenShell Agent-Driven Policy Management[/+]on Apr 29, 2026 Update from #1151 — the foundation slice is in review and covers the
sandbox-local agent loop end-to-end. Posting the punch list against the
1090–1099 tickets so this issue stays the roadmap ledger.Closeable on #1151 merge
- feat(policy): add agent-readable L7 deny body #1090 — agent-readable L7 deny body. Delivered: structured 403 with
layer,method,path,host,port,binary,rule_missing,
next_stepsfields, plus matching unit tests and architecture-doc update. - docs(agent): ship static sandbox policy advisor skill #1095 — static policy-advisor skill. Delivered: skill is bundled into
the supervisor binary viainclude_str!and installed at
/etc/openshell/skills/policy_advisor.mdmode0o444on sandbox
startup. The skill points at the livepolicy.localroutes; renaming a
route only requires updating the route constants inpolicy_local.rs.
Supersede / re-scope
- feat(policy): write effective sandbox policy for local agents #1091 — write effective policy to
/etc/openshell/policy.yaml.
feat: agent-driven policy management MVP #1151 exposes the effective policy as YAML viaGET /v1/policy/currentinstead of writing a file. Same goal (agents can
read the effective policy without root or runningopenshell rule get), better surface (no FS races, lifetime tracks the supervisor).
Suggest closing feat(policy): write effective sandbox policy for local agents #1091 as superseded by the API.
Partial — follow-ups needed
-
feat(policy): expose sandbox-local policy.local API #1092 — sandbox-local policy.local API. Three of six planned routes
are in:GET /v1/policy/current,GET /v1/denials,POST /v1/proposals. Still planned:GET /v1/logs(agent-friendly recent
log tail),POST /v1/prove(run prover on a draft locally before
submit),GET /v1/proposals/{id}(status check after submit). The
proposal submit also doesn't return chunk IDs to the agent yet —
blocked on feat(policy): return draft chunk ids from policy proposal submit #1094. -
feat(observability): enable OCSF JSONL for agent deny inspection #1093 — OCSF JSONL for agent deny inspection. The consume path is
in (/v1/denialsreads recent denials), but the source switched: the
endpoint now reads the always-on shorthand log
(/var/log/openshell.YYYY-MM-DD.log) instead of the OCSF JSONL.
Rationale: avoids changingocsf_json_enableddefault, agents read
raw shorthand, schema evolution is a single-file change in
openshell-ocsf. The DoD line that asked for "MVP profile enables
OCSF JSONL by default" is no longer required by this consumer; the
JSONL still exists for SIEM ingestion but stays opt-in. Re-scope or
close as you see fit.
Untouched in #1151 — next-PR slicing
These are the next critical-path slice. Ordering matters because some
depend on the proto fields:- feat(policy): add proposal provenance, operations, and guidance fields to proto #1096 — additive proto fields for proposal metadata (provenance,
summaries, operations, rejection guidance). - feat(policy): return draft chunk ids from policy proposal submit #1094 — return draft chunk IDs from
SubmitPolicyAnalysisso
agents can correlate submitted proposals with subsequent status
queries. - feat(gateway): persist and validate agent policy proposal operations #1097 — gateway-side validation of agent-authored operations
(consumes proto fields from feat(policy): add proposal provenance, operations, and guidance fields to proto #1096; persists with audit trail). - feat(tui): render policy proposal inbox metadata #1098 — TUI inbox rendering of the richer proposal metadata.
- feat(policy): suggest L7 scoping for known REST hosts #1099 — local prover wiring for
/v1/prove.
Likely PR slicing for the next chunk of work:
feat(policy): proto fields for agent proposal metadata + chunk IDs
— combines feat(policy): add proposal provenance, operations, and guidance fields to proto #1096 + feat(policy): return draft chunk ids from policy proposal submit #1094, smallest reviewable slice that unblocks
the rest.feat(gateway): validate and persist agent-authored policy operations
— covers feat(gateway): persist and validate agent policy proposal operations #1097 once proto is in.feat(tui): render agent policy proposal inbox metadata— covers
feat(tui): render policy proposal inbox metadata #1098.feat(policy.local): prove route— covers feat(policy): suggest L7 scoping for known REST hosts #1099 (and rounds out
feat(policy): expose sandbox-local policy.local API #1092).
Out-of-scope reminders
The MVP loop intentionally defers: multi-sandbox push inbox, Slack/web
inbox adapters, supervisor UDS API, in-process prover optimization, org
ceiling and trusted external auto-apply, per-binary auto-approve
patterns. All still tracked under this umbrella.- feat(policy): add agent-readable L7 deny body #1090 — agent-readable L7 deny body. Delivered: structured 403 with
This issue has had no activity for 14 days and is now marked stale. It may be closed in 7 days if there is no further activity. Comment or remove the state:stale label to keep it open.
- addedstate:staleInactive item at risk of automatic closure.Inactive item at risk of automatic closure.
on Aug 30, 2026
Product Goal
OpenShell should provide an agent-driven policy management workflow that lets agents inspect current policy, draft narrow changes, and route them into a responsive reviewer inbox.
Roadmap context: #1038 is the public Policy Advisor roadmap card. This issue tracks the concrete MVP implementation for the agent-driven policy approval loop.
The core loop:
/wait, observes the decision, and either retries or redrafts.GitHub issues are the public development source of truth for this MVP. Earlier RFC/branch artifacts were planning notes and should not be treated as durable public references.
Locked MVP
policy.localHTTP API.PolicyMergeOperation/ incremental policy update shape./etc/openshell/skills/policy_advisor.mddocumenting thepolicy.localworkflow./waitendpoint so agents can sleep on one long-lived request instead of polling or burning tokens.Non-Negotiable Trust Boundary
The proposing in-sandbox agent can submit policy proposals and read proposal outcomes. It cannot act as its own reviewer, directly approve or deny chunks, bypass the configured approval policy, or mutate live policy.
AI policy review belongs in the trusted OpenShell control-plane path, alongside gateway-side prover validation. A reviewer agent must evaluate structured proposal context from outside the proposing sandbox and record decisions through the same draft chunk approval/rejection paths as a human reviewer, with explicit provenance and audit events.
Automatic approval is in scope. The distinction is where the decision runs and under whose authority: small, well-scoped proposals may be approved at agent speed by configured control-plane review policy; broad, ambiguous, conflicting, or high-risk changes must remain human-required.
This is required MVP scope for a current, SOTA agent policy architecture: deterministic prover checks answer what can be mechanically verified; control-plane AI review provides contextual judgment over intent, suspicious broadening, and reviewer guidance. The UI must keep those signals distinct.
Simplicity Constraint
Keep the implementation small, inspectable, and easy to change while we learn. Prefer Sutton/Bitter-Lesson-friendly mechanisms: compute from the current policy, proposal, denials, and logs; give the reviewer concise context; store concise outcomes; iterate with replay fixtures.
Do not build a heavy evidence ontology, approval DSL, normalized review database, or service-specific intent taxonomy for the MVP. Reuse existing
PolicyChunk/draft chunk fields, existingvalidation_result/rejection_reasonstyle strings, and OCSF shorthand/log summaries where they are enough. Add new schema only when an experiment proves a value cannot be represented simply.Review Primitive
The base primitive is broader than "AI approves policies":
This lets us experiment with which actions can be automated through a combination of intent-based policy, formal methods, and AI review. The minimal shape should support:
Tactical Implementation Order
Explicit Non-Goals For MVP
WatchProposals.policy.locallater, but is not load-bearing for MVP.Development Issues
Follow-Up Themes
Cross-Track Notes