- Home
- Skills
- Agents & Orchestration
- Simulate Before Execute
Works with the AI Agents you already use
Simulate Before Execute
Makes your agent test a risky change away from live systems, compare it with doing nothing, and act only when a gate script or a person approves it.
$9
Simulate Before Execute
Example session with this skill installed
Checkout errors spike every evening. I'm thinking of either scaling the workers to 8 or cutting the timeout to 400 ms. Test both, and only change production if the evidence supports it.
- Read your context and instructions
- Compiled the simulate before execute
The figures below are sample data from
examples/scale-workers.json, which ships with the skill. The gate values are real output from runninggate.pyon that file, so you can reproduce them.
Summary
I tested both plans on replayed evening traffic, 3 runs each, alongside doing nothing. Scaling to 8 workers passes the gate. The timeout change doesn't.
Terms set before testing: metric error_rate (lower is better), minimum gain 0.02, allowed actions SCALE_WORKERS (2 to 12) and SET_TIMEOUT_MS (200 to 5000).
Results
| Plan | Runs | Mean error rate | Gain | Spread | Risk |
|---|---|---|---|---|---|
| Do nothing | 3 | 0.0810 | n/a | n/a | n/a |
scale-to-8 | 3 | 0.0413 | 0.0397 | 0.0012 | LOW |
short-timeout | 3 | 0.0667 | 0.0143 | 0.0591 | HIGH |
Gate verdict
{
"decision_hash": "0e5ce5a75c4561a2",
"recommended": "scale-to-8",
"execution": [
{
"key": "0e5ce5a75c4561a2:scale-to-8:0:SCALE_WORKERS",
"type": "SCALE_WORKERS",
"params": {"count": 8}
}
],
"status": "auto_approved",
"reason": "risk LOW and gain 0.03967"
}
Why the timeout plan lost
Its error rate ranged from 0.02 to 0.15 across the 3 runs. One good run would have made it look like the winner, but the spread of 0.0591 is above the 0.05 limit, so the gate marked it HIGH risk. Its gain was also below the 0.02 minimum.
What the test couldn't show
- Replayed traffic may not match a real peak.
scale-to-8carries one low finding: it adds 3 workers, which costs more.
Next steps
- I'll rerun the gate on the current decision file and confirm the hash hasn't changed.
- I'll claim the key with
gate.py claim, which exits with code 3 if it was already used. - I'll scale to 8 workers, change nothing else, and report the real error rate against the expected 0.0413.
Connects securely to your tools. The creator never sees your data.
About this skill
An agent that can change production can also break it. This skill gives your agent a fixed routine for risky changes: test first, compare with doing nothing, and let a small script decide whether the change can go ahead without a person.
The agent proposes. Evidence decides.
What it does
- Sets the terms first. The goal, the metric, the minimum gain, and a closed list of allowed actions are written down before any plan exists, so a threshold can't be chosen to suit a favourite plan.
- Always compares with doing nothing. Every plan is measured against the same baseline, under the same conditions, across at least 3 runs.
- Judges the evidence with a script.
gate.pydrops actions outside the list, clamps parameters to their limits, flags regressions and unstable results, scores the risk, and returns one of three outcomes:auto_approved,needs_human, ordo_nothing. - Keeps a person in charge of the dangerous parts. Actions marked
requires_humannever pass automatically, and the agent is told it can't approve its own plan. - Stops double execution. Each action gets a key that can only be claimed once, using an atomic file create.
What's in the package
SKILL.md: the 8-step routine your agent followsscripts/gate.py: the gate, in Python standard library only, with no network callsreferences/decision-file.md: the decision file format and the exact rulesreferences/test-methods.md: ways to test by domain (Terraform, Kubernetes, databases, feature flags, scheduling, pricing, bulk data edits) and what each one can missexamples/: two decision files you can run right away
Good fit
- Scaling, config, routing, or schedule changes made by an agent
- Database migrations that can be tried on a restored snapshot
- Deciding which agent actions are safe to run without a person
Known limitations
- It doesn't run tests for you. You need a dry run, staging copy, replay, or simulator. Without one, the plan goes to a person.
- It can't detect made-up results. The skill tells the agent never to invent numbers, but the gate only judges what it is given.
- Passing isn't proof of safety. It means the plan beat doing nothing in your test. Whether that test resembles production is still your call.
- The rules are instructions to your agent. The gate reports a verdict and the ledger records claims, but neither one blocks an agent that has direct access to production. Limit that access separately.
Where it comes from
The approach comes from the safety design of NEXUS, my open-source warehouse digital twin. The risk weights and approval logic are adapted from it and generalised so they work with any metric. The benchmark results published for NEXUS measure that system, not this skill.
Requires Python 3.9+. You provide the test method. The gate judges the results it is given and can't detect made-up numbers. It doesn't block an agent that has direct access to production, so limit that access separately.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before any payment.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 15 days ago
Requires
Permissions
Terminal runs scripts/gate.py. Read and write cover the decision file and the .gate-ledger folder. gate.py makes no network calls. The tools you use to test or apply a change have their own access, separate from this skill.