- Home
- Skills
- Agents & Orchestration
- approval-gated-writes
Works with the AI Agents you already use
Approval Gated Writes
Gate agent writes behind human approval: single-use tokens, typed fallback when buttons fail, datastore-agnostic by design.
$69.96
approval-gated-writes
Example session with this skill installed
An approval card went out for deal D2026-DEMO, field Status, value
Active. The operator approved it. Apply the write through the gate,
then verify the same approval cannot be applied a second time.
- Read your context and instructions
- Compiled the approval-gated-writes
=== D04 REUSE-REJECTION REPLAY ===
create_gate('D2026-DEMO', 'Status')
→ gate_D2026-DEMO_Status_YYYYMMDDTHHMMSSZ.json
check_gate('D2026-DEMO', 'Status')
→ 1 gate file(s): ['gate_D2026-DEMO_Status_YYYYMMDDTHHMMSSZ.json']
clear_gate [consume on apply]
→ cleared: ['gate_D2026-DEMO_Status_YYYYMMDDTHHMMSSZ.json']
→ write_fn called with: deal_id='D2026-DEMO', field='Status', value='Active', source='confirm'
check_gate [AFTER apply — reuse attempt]
→ 0 gate file(s): []
clear_gate [REUSE ATTEMPT — no gate present]
→ cleared: [] ← empty; gate already consumed
→ write_fn call count before: 1 after: 1 ← no new write = REUSE REJECTED
supersede_gate('D2026-DEMO', 'Status') [re-issue]
→ superseded: []
→ new gate: gate_D2026-DEMO_Status_YYYYMMDDTHHMMSSZ.json
invalidate('D2026-DEMO', 'Status') [direct-write protection]
→ cleared: ['gate_D2026-DEMO_Status_YYYYMMDDTHHMMSSZ.json']
Connects securely to your tools. The creator never sees your data.
About this skill
The problem
Agents that write to CRMs and datastores need human approval on sensitive fields. Most implementations handle the happy path: card sent, button tapped, write applied. Production breaks elsewhere. Buttons fail to render while the API reports success, approval tokens turn out to be reusable, and a stale approval card overwrites a field someone already edited directly.
What it does
- Manages the full gate-file lifecycle: create, check, clear, supersede, invalidate. Gates are JSON files on disk, one per (record, field) slot, consumed by deletion on apply.
- Your datastore write is caller-supplied via
GATE_CONFIG["write_fn"]: Sheets, SQL, or API. The gate layer never touches your data directly, and a failed write never consumes the gate. supersede_gateatomically replaces an old gate when a card is re-issued, so two approvals for one slot cannot both apply.invalidateclears a pending gate without applying it. Call it from your write path after any direct edit to the same field, so a stale approval card cannot overwrite fresh data.card_guardenforces Telegram's 64-byte callback limit before send (alert plus hard stop) and verifies buttons actually rendered after send.typed_token_fallbackprovides single-use typed approval when buttons fail: the token is consumed by file deletion, and a second attempt is rejected by the file's absence.
Frameworks & tools
Python 3.11+, standard library only. Zero external dependencies. Telegram Bot API via urllib for cards and alerts.
Why this beats prompting it yourself
The primitives in this gate grew out of documented production failures: inline buttons that never rendered while the send API reported success; an oversized callback that Telegram rejected loudly but the sending tool layer swallowed, making the failure silent; an approval token that was not actually single-use until a human typed the reuse test and caught it; and three separate orphaned-gate incidents that produced the supersede and invalidate primitives. Each incident is documented in the included PROVENANCE.md, dated, and mapped to the test that now catches it.
The suite collects 19 cases across three test files; a standard run reports 19 passed, 0 skipped. It includes a behavioral reuse round-trip that consumes the token by file deletion and proves the second attempt bounces with the exact rejection message.
Use cases
- Requiring operator sign-off on CRM status changes and financial fields before an agent writes them.
- Gating infrastructure changes or elevation requests behind a secondary human sign-off.
- Agent fleets using Telegram as the human-approval channel, with a typed fallback for clients where buttons fail.
- Any propose, approve, write flow where a write must be provably tied to one human action, and where a stale approval must never overwrite a direct edit.
Known limitations
Requires a local directory for gate-file storage (created automatically; path configurable). Standard library only, so you wire your own write_fn for your datastore, and your own dispatch handler scripts if you use the subprocess routing table. Cards and alerts are Telegram-specific by design, with documented swap points. A CRM integration example is documented in SKILL.md but not included as runnable code.
About the builder
Built by Tradeplier: a licensed Massachusetts builder running a $1M/yr construction company on an agent back office, in production since April 2026. We file the bugs we find upstream: six issues on openclaw/openclaw to date, four rated diamond lobster by the project. If this skill breaks in your fleet, the incident becomes a test and you get the fix. The full audit story, including the part where the audit caught these packages themselves, is at https://www.tradeplier.com/audit-story/
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Agents & Orchestration.
Cards and alerts are Telegram specific by design, with documented
swap points for other channels. You wire your own write_fn into
GATE_CONFIG for the actual datastore write, and your own handler
scripts if you use the subprocess routing table. A CRM integration
example is documented in SKILL.md but not included as runnable code.
Gate files require a local directory (created automatically; path
configurable via GATE_DIR). Tested in production on OpenClaw, macOS
Apple Silicon and Linux, Python 3.11+; the logic is portable but has
not been operated on other runtimes. The shipped suite covers the
gate primitives, the typed-fallback reuse round-trip, and behavioral
callback-length enforcement; the multi-action routing round-trip is
validated in the originating production fleet.
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 buying a skill.
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 3 months ago
- Accounts
Telegram
Permissions
Allowed Hosts
File Scopes
Network: one host, api.telegram.org, direct urllib POST for approval cards and alerts; the bot token is read from a file path you configure and embedded in the request URL at call time. Shell: one subprocess call, list form, no shell=True, dispatching handler scripts from your own configured table; never built from user input. Writes: gate JSON files in the configured gate directory plus two append-only JSONL logs; defaults for all of these live inside the skill folder, and if you point GATE_DIR or the log path elsewhere, writes follow your configuration. Deletions: gate files are consumed by deletion on apply or supersede, and the fallback token state file is deleted on first valid use; deletion is the single-use mechanism. Env vars: GATE_DIR and GATE_LOG_FILE, both optional with in-package defaults. No telemetry, no other hosts, no external dependencies.