Repository navigation
feat(automations): an automation's action that asks first waits as an approval - #447
Merged
Merged
Conversation
… approval
approvals.ask keeps an intent that asks first as an approval of the automation's
person, tells them once in their chat app, caps 100 waiting per automation and
expires undecided ones after automations.approval_days (Settings > Automations,
default 7) with nothing run. Approving performs the intent as the automation;
decline, edit (params checked against the action's schema) and always (the node
runs on its own from now on) are the other picks. Only the person approves, signed
in: an API key or an app can list and decline. GET /api/v1/approvals gains
filters and paging, with /approvals/count and /approvals/{aid}.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VF3LK1DBx3dXX2b8c5T3cQ
Moves P-AUTOMATION-APPROVAL into the claimed properties table and adds it to threat-model.yaml and threat-model.json with the prose hash. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VF3LK1DBx3dXX2b8c5T3cQ
Keeps automations.catch_up (timers) beside automations.approval_days in the settings, defaults, docs and the hourly tidy. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VF3LK1DBx3dXX2b8c5T3cQ
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VF3LK1DBx3dXX2b8c5T3cQ
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VF3LK1DBx3dXX2b8c5T3cQ
This was referenced Oct 16, 2026
This file contains hidden or bidirectional Unicode text th
6D94
at may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Adeel · project thread
Description
Before: approvals were only the assistant's proposals in a conversation. An automation's action that asks first (a post to a room, a change to another asset) had nowhere to wait, and
GET /api/v1/approvalslisted the last 100 with no filters.After: workflow studio M8, part 1 of 5. The engine hands such an intent to
approvals.ask(db, cfg, intent, event=None). That keeps it as an approval for the automation's person: what it would do, the activity that caused it, and when it expires. The person is told once in their own chat app: "School emails wants to post … Open to decide." Nothing runs until they pick:actions.perform, as the automation and for its person. Model calls go in the ledger under the run, and what it causes carries the run as its cause. The outcome (doneorfailed) goes on the approval and on the run (automations.update_intentonce M6 lands).params, checks them against the action's schema, then performs. Credential headers stay hidden and sealed.auto(automations.set_policy). Only actions that reach outside Lens can be set this way, and only once M6 has landed. Until then it says "approve it this once".Approving, editing and always need the person signed in. An API key or an app can list and decline, and each approval's
cansays what the caller may do. Two decisions at once can't both run it (a claim on the row). At most 100 approvals wait per automation; past that its intents are dropped and the run says so. Undecided ones expire afterautomations.approval_days(Settings → Automations, default 7) via an hourly sweep fromroutines.run_due, and nothing runs.GET /api/v1/approvalsgainsstatus,origin=automation|chat,automation,beforeandlimit. New:GET /approvals/count(for the badge) andGET /approvals/{aid}.POST /approvals/{aid}gainsedit(withparams) andalways.Defaults picked (reversible): API keys and apps can't approve automation approvals (the brief's "agents never approve"); the assistant's own chat approvals work exactly as before and never expire.
Motivation and Context
Adeel's workflow studio, module M8 (approvals inbox), brief in the project's
workflow-studio/briefs/M8.md. Next PRs: a yes in your own chat, approval activities and notifications, agents' approval tools, the/approvalspage with a top-bar badge.Types of changes
!in the title)Checklist:
make hookschecks it on commit).docs/accordingly.## UnreleasedinCHANGELOG.md. (n/a: studio modules land under one release note)Done questions (AGENTS.md)
automations.approval_daysin Settings → Automations, default 7, out of the wizard.P-AUTOMATION-APPROVALinthreat-model.md(approval flooding, who approves).DEFINE INDEX IF NOT EXISTS, so no upgrade step is needed.tests/api/test_approvals.py), docs (automations.md,api.md,configuration.md) and the client regenerated withmake openapi.docs/automations.md(cost estimates on asked actions, chat buttons, two-person approvals, batching, retrying a failed one, expiring when an automation is removed).🤖 Generated with Claude Code
https://claude.ai/code/session_01VF3LK1DBx3dXX2b8c5T3cQ
Generated by Claude Code