Repository navigation
Description
Summary
After a user approves a permission card, the tool result received by the agent is a normal success/allow. It contains no request identifier, decision, actor, or timestamp, and the session record has no permission field. The agent therefore cannot distinguish a configuration allow from a user-approved ask.
Environment
- OpenCode 2.3.0 (Windows)
- OpenChamber 2.7.2 (UI/card host)
- Permission modes
safetyandask - File tools (
write,edit), actionedit;FileWrite.authorize
Observed
- A tool call matches an
edit: askrule. - The UI shows a permission card; the user approves it.
- The tool call returns a normal success (for example
Created file successfully). - The session record and the tool result contain no indication that a permission request occurred or how it was decided.
The permission.asked event exists and is handled by the card host, but it is not queryable by the agent or persisted with request/session identity in a way the agent can cite.
Consequence
An agent cannot attest whether a write was allowed by configuration or by a human approval. A probe that expects ask reports allow and may incorrectly conclude that no card appeared; we observed exactly this misreport before the user confirmed the cards. For audit and test evidence, the permission decision is not attributable.
Proposal
One of:
- Attach a permission decision reference to the tool result: request id, action, resource, effect, actor, timestamp — or at least a boolean
permission_requested/permission_approved. - Persist
permission.asked/permission.repliedwith request and session identity in a queryable session event or DB, exposed via the API. - If neither is intended, document explicitly that agent-side
askattestation is impossible and that only the UI/user channel can prove it.
Non-goals
The opt-in timeout/deny behavior for unanswered requests is a separate OpenChamber issue (openchamber/openchamber#7026). This issue is about observability and attestation of the decision itself.
Evidence notes
- Tool result after approval: normal success, no extra fields.
- Session record: no permission/mode field.
- UI: permission card visible; approval accepted.
- No secrets or session data are included here.
Activity
opencodejr commentedon Nov 17, 2026
Thanks for the clear write-up, @martinderm. As I understand it, you want an agent, and later an audit, to be able to tell a tool call allowed by configuration from one a person approved through an
askprompt. That means putting the permission decision (request id, action, resource, effect, actor, timestamp) on the tool result or storing it with the session.From the code, this is how it currently works rather than a bug.
permission.askedandpermission.repliedare defined as ephemeral events, so they are not stored in the session history. The tool result has no permission field. I've marked this as a feature request, and the maintainers will consider it. I can't say what they'll decide.Related issues:
ask. In that case no prompt appears, so "no prompt" doesn't always mean "allowed by config".Until then, a plugin can cover much of your first proposal. It subscribes to the permission events and uses the
execute.aftertool hook to add the decision to the tool result, so the agent sees it and it is saved with the result. I type-checked this against@opencode/pluginbut haven't run it in a live session. Save it as.opencode/plugins/permission-audit/index.ts(plugins there load automatically):Limits:
Closing those gaps would need core support, such as a hook or field that reports the final permission decision for each tool call.
martinderm commentedon Nov 18, 2026
Empirical data point on the saved-approval side
Thanks for the triage and the plugin sketch. The plugin helps for the prompted case, but the no-prompt case is not just ambiguous in theory. We audited a real multi-project Windows setup (OpenCode 2.3.0, OpenChamber 2.7.2):
permissiontable holds 159 saved approvals across 18 project records; 127 are active, 32 legacy (V1-only or zero sessions). The busiest project alone has 53.python -B *,python -X *,opencode *,git -C *,git checkout *,git push *,gh pr merge *,gh repo create *,Remove-Item *,Stop-Process *,Get-Content *.ask, so no card appears. Your plugin then reportsprompted: false— exactly the case it cannot distinguish from "allowed by configuration". In the busiest project this affects 35 broad entries.git -C *matchesgit -C repo reset --hard, andgit push *is additionally allowed in the build agent.So
prompted: falsecannot be used as an attestation, and #48456 is not theoretical. Two questions:permissiontable the only interface?No secrets or session data are included; only aggregate counts and generic patterns.