[Feature Request] Expose subagent security-warning banners to the calling session and Workflow scripts
When a dispatched agent draws a harness security warning, the banner reaches only the transient task notification and (post-run) the workflow run-record JSON under ~/.claude/projects/<projectSlug>/<sessionId>/workflows/<runId>.json (logs[]). Neither agent() results in Workflow scripts nor Agent tool results carry it, so orchestration pipelines that keep durable records (ledgers, audit logs) record a clean success for a flagged run — the warning exists, but never anywhere the calling code can read at the moment it matters.
Concrete case: our quest-runner Workflow appends a DONE line per completed run. A run whose executor drew a security warning got a clean DONE; the flag survived only in the notification. We now close the gap with a post-run script that parses the run-record JSON — it works, but it depends on an undocumented file layout and can only run after the workflow returns.
Ask: include per-agent warning metadata (agent label + warning text, or even just a boolean + reason) in agent() results and Agent tool results, so callers can record flags in their own durable outputs synchronously.
Benefit: any workflow-dispatching tool can keep honest records without parsing internal files; the warning's audit trail becomes the caller's responsibility instead of being lost by default.
🤖 Generated with Claude Code