Runtime Lifecycle Extensions Development SOP
1. Decide whether an extension is necessary
- Do not create an extension when configuration, the Tool API, workflows, or ordinary event subscriptions solve the problem.
- Record the required event, input fields, output side effects, failure behavior, and owner.
- Stop if the design needs to change approvals, checkpoints, terminal states, or provider-private objects; those are outside the public surface.
2. Define capabilities and trust
- Use a stable lowercase id and an explicit version.
- Declare
files,process,network,credentials, andui; request the minimum. - Register the extension in host code, add its id to
trustedIds, and grant only required capabilities. - Never scan a workspace or infer trust from file presence.
3. Implement handlers
- Handle only required events and treat payloads as read-only.
- A
before-toolhandler may return{ deny: { reason } }or no decision. - Export only required fields. Never record credentials, complete private user data, or provider-private objects.
- Keep handlers idempotent, short, and bounded. External failure must be visible in receipts without changing Runtime outcome.
4. Failure and security tests
- Test synchronous and asynchronous handlers.
- Inject a never-settling promise and verify a
timed_outreceipt plus truthful Runtime completion. - Inject a failure and verify redaction and isolation.
- Deny a tool in shared or human policy and verify the extension cannot execute or rewrite denial.
- Let shared policy allow, then deny in the extension; verify no tool or checkpoint runs.
- Verify
run-finishedsees the true completed, paused, or failed operation. - Verify outputs contain no test key, authorization header, cookie, private key, sensitive URL parameter, or command secret, while ordinary business fields remain intact.
5. Delivery and rollback
- Run the module tests and
npm run check:modules. - Execute the same interactive cases on Windows and Linux.
- Preserve the extension version, grants, timeout, trace, and receipts.
- Roll back by removing the extension from
extensions,trustedIds, andgrants; retain audit evidence. - Do not commit, push, or publish without explicit authorization.