agentsafe
Skill672 starsChanged 2 days agoApache-2.0View on GitHub
Put AgentSafe in front of an agent's writes: register native executors, pin a route to a published policy, start in shadow, and stop on BLOCK and ESCALATE.
- Reads credentials
- Installs packages
In this repository10 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .cursor/rules/AgentSafeImplementation.mdcCursor rule
- .cursor/rules/PolicyAuthoring.mdcCursor rule
- .cursor/rules/WorkflowSetup.mdcCursor rule
- llms-full.txtllms.txt
- llms.txtllms.txt
- policyauthoringSkill
- workflowsetupSkill
- Decionis Commerce GateSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 3 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 44
Always pass the idempotency key to the provider, and implement reconcile as a read-only lookup.
- Distinctive: line 86
Stop on BLOCK and ESCALATE.
- Distinctive: line 88
Never rename ALLOW, ESCALATE or BLOCK, and never map them to other words in code.
- Distinctive: line 89
Never put keys, tokens or customer payloads in configuration files, logs or examples.
≈ “Common” is an estimate: at least 1 in 5 of the 364,980 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
<!-- Generated by Decionis. Installing a newer version replaces this file. -->AgentSafe Implementation
AgentSafe puts authorization in front of every write an agent makes. The agent sends its action to AgentSafe instead of the target. Decionis decides the exact action, and AgentSafe runs it once, holds it for a person, or refuses it. AgentSafe decides nothing itself, and the agent never receives a grant or a credential.
Source and full docs: https://github.com/decionis/agent-safe-pipeline.
Pick the shape
- HTTP interception (
agentsafe proxy). Put the gateway in front of an API. EveryPOST,PUT,PATCHandDELETEbecomes an intent. On ALLOW it is forwarded byte for byte, once, under a single-use grant. BLOCK is refused, ESCALATE is held. OnlyGET,HEADandOPTIONSpass without a decision. - Proposal executor (
agentsafe serve). Register a handler per action. The handler does the provider call and nothing else. - Library (
@decionis/agent-safe-pipeline).SafeExecutor,ActionRegistry,IntentCapture,DecionisGate,DecionisGrantVerifier,ShadowPipelineandAuditRecorderinside your own service.
npm install -g @decionis/agentsafe
agentsafe proxy --upstream http://localhost:3000 --port 8080
agentsafe doctorWithout a Decionis key the proxy runs a local demo authority with a synthetic policy and says so on every line. With DECIONIS_API_KEY and DECIONIS_TENANT_ID (or agentsafe login) it asks Decionis.
Register an action
registry.register("create_payout", {
parametersSchema: JsonObjectSchema,
execute: ({ intent, parameters, authorization, dispatch }) =>
dispatch.run(async (idempotencyKey) => {
// The provider call, and nothing else. Send idempotencyKey to the provider.
}),
reconcile: async ({ idempotencyKey }) => {
// Read-only: ask the provider what happened to this key. Never send again.
},
});- Validate parameters with a schema. Never trust fields the agent sends for policy selection.
- Always pass the idempotency key to the provider, and implement
reconcileas a read-only lookup. - Credentials come from the runtime per request. Handlers never hold their own.
The executor contract
New executors follow agent-safe.executors.native/1 (spec/executors/native/v1). Every run ends in exactly one of six outcomes:
| Outcome | Meaning | Retry? |
BLOCKED | No valid execution authority reached the executor | Fix the authority first |
HELD | Admitted; the grant waits for the native boundary | No |
FAILED_BEFORE_DISPATCH | A grant was used and nothing was sent | Only with a fresh decision and grant |
COMPLETED | The platform did the action | No |
DEFINITELY_NOT_EXECUTED | The platform refused; nothing happened | Only with a fresh decision and grant |
UNKNOWN_AFTER_DISPATCH | The write left and the result is unknown | No; reconcile first |
EffectAdapter is deprecated. Use NativeExecutor with style: "dispatch".
Pin a route to a policy
A route can select the published Decionis policy that decides it. action names what rules match; it does not select a policy.
interception:
routes:
- path: /decide
action: payment.decide
methods: [POST]
policyId: "<published policy bundle UUID>"
policyVersion: "<exact published version>"The gateway binds these as parameters.policy_id and parameters.policy_version before hashing. Fields in the request body cannot override them.
Roll out
- Shadow first. Shadow records what Decionis would have allowed, held and refused, and executes nothing.
agentsafe statusshows the shadow report. - Review the report with the policy owner. Change the policy, not the gateway, when outcomes are wrong.
- Enforce with the switch the report names.
Rules
- Stop on BLOCK and ESCALATE. Never route around AgentSafe through another tool, API, browser or script.
- An unreachable authority is its own state, never a verdict. Do not treat it as ALLOW.
- Never rename ALLOW, ESCALATE or BLOCK, and never map them to other words in code.
- Never put keys, tokens or customer payloads in configuration files, logs or examples.
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.

