approval-and-safety
Skill0 starsChanged 4 days agoMITView on GitHub
Which actions ask the person first, how the UI, the assistant and the CLI differ, which actions the assistant must never see, and what the assistant hears after a rejection. Use when writing an action that deletes, changes much at once, or touches secrets.
In this repository29 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- accessibilitySkill
- actionsSkill
- adding-a-featureSkill
- agent-workflowSkill
- app-contextSkill
- backend-proxySkill
- background-workSkill
- build-an-appSkill
- capture-learningsSkill
- clean-architectureSkill
- customizing-the-assistantSkill
- delegate-to-agentSkill
- edit-boundariesSkill
- i18n-and-rtlSkill
- model-providersSkill
- performanceSkill
- permissions-and-platformSkill
- read-the-docsSkill
- reliable-mutationsSkill
- routingSkill
- secretsSkill
- state-managementSkill
- storing-dataSkill
- testingSkill
- ui-designSkill
- upgrade-the-frameworkSkill
- verifySkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 0 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 8
Don't load this for how to write an action in general.
- Very specific: line 29
Don't add a "are you sure?" step in the chat.
- Very specific: line 31
Keep the confirm dialog in the screen (_confirmDelete in lib/presentation/home/home_screen.dart).
- Very specific: line 34
Test it like test/actions/delete_item_test.dart: requiresApproval, refused without approval, works with approved: true, works for the UI, …
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Approval and safety
Don't load this for how to write an action in general; see actions.
Rule
needsApprovalreturns true for deletes, bulk changes and anything irreversible (DeleteItemandDeleteItemsinlib/domain/actions/items_actions.dart).- Anything destructive also sets
bool get allowAlways => false, so the card offers no "Always allow" and every call asks again. - Give such an action an
approvalSummary(input): one line the person reads on the card, such as the title of the item a delete removes (DeleteItem.approvalSummary;DeleteItemslists the first five titles). update_itemclearing a description is allowed without approval: it is one field of one item, and the receipt and the returned item show the change.- The UI is never paused by approval, so a screen keeps its own confirm dialog.
- The action CLI needs
--approvedfor such actions. - An action touching secrets or the model setup is UI-only:
bool get agentTool => false(SetApiKey,SetAssistantProviderandResetApprovalsinlib/domain/actions/settings_actions.dart).
Enforced by the registry's approval gate, tested in test/actions/delete_item_test.dart (a call without approval fails with approval_required and changes nothing). The agentTool flag has no test of its own, and no check decides which actions deserve approval.
Why
The registry lets Caller.ui through run (the person pressed the button; call with JSON input refuses it) but refuses Caller.assistant and Caller.cli unless approved. For the assistant, the run pauses and the app shows an approval card. A hidden action cannot be called by a confused or misled model, so keys never pass through the chat.
How
- Make
needsApproval(input)depend on the input when only some calls are risky; return true when unsure. - Don't add a "are you sure?" step in the chat. The system prompt in
assets/assistant/instructions.mdtells the assistant to calldelete_itemright away and let the card ask.
<!-- @example:begin -->- Keep the confirm dialog in the screen (
_confirmDeleteinlib/presentation/home/home_screen.dart). It is the UI's own safeguard.
<!-- @example:end --><!-- @empty: - Keep the confirm dialog in the screen (see `_confirmDelete` in .agents/example/lib/presentation/home/home_screen.dart). It is the UI's own safeguard. -->- Test it like
test/actions/delete_item_test.dart:requiresApproval, refused without approval, works withapproved: true, works for the UI, the summary andallowAlways. - With the CLI:
dart run tool/action.dart <action_name> '<json>' --approved.
After a rejection. The model gets {"error":"declined","message":"The user declined this action."}, and the core rules tell it to stop or change its plan, not repeat the call. Nothing runs and no receipt is written. Your instructions should say what to tell the person ("leave the item and say so"). Approving with "always" is stored in ApprovalPrefs; the app persists it in lib/data/repositories/prefs_approval_prefs.dart. Settings has "Ask again before every action", which runs the UI-only reset_approvals and clears them all.
Anti-patterns
- A delete or bulk action without
needsApproval, or withallowAlwaysleft true. - Removing the UI's confirm dialog because "the registry asks".
- Giving the assistant an action that takes or returns a key.
- Asking for approval in the chat text instead of calling the action.
- Retrying a declined call.
Verification
flutter test test/actions/<action_name>_test.dart, and the same shape for each new risky action.- The parity test requires that test file to exist.
tool/check.shends withAll checks passed.- Further reading:
dart run flutter_agentify_core:docs --query "needs approval".
Related skills
actions— the flags and the rest of the action contract.app-context— what the model is shown, which must hold no secrets.adding-a-feature— where approval fits in the checklist.secrets— why keys never reach the model.edit-boundaries— what a coding agent may change without asking.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

