A standing grant is a short-lived, capped permission learned from your own approvals. This page explains exactly when one forms, what it covers and how it ends.
The idea in one minute
A standing grant lets Splicedock approve a repeated, low-risk operation without asking a human again. It is learned, not configured: after you approve the same kind of operation three times and each run succeeds, Splicedock remembers that shape for a short time and a limited number of uses.
Three rules explain almost everything that follows. The shape decides: what the operation is, where it runs and which objects it touches. The caller’s words can only subtract: the approval_context text can send a request back to a human but can never be the reason it runs. When unsure, ask a human: every check below fails closed.
What you must turn on
| Setting | Effect |
|---|---|
SPLICEDOCK_GRANTS=1 | Enables learning and matching. Default: off. |
SPLICEDOCK_GRANT_NAMESPACES | Comma-separated exact namespaces where grants may form and match. Default-deny: empty means grants are effectively off. |
SPLICEDOCK_GRANT_THRESHOLD | Successful, consistent approvals needed to learn a grant. Default 3. |
SPLICEDOCK_GRANT_EXCEPTIONS | JSON array of {"tool","verb_path"} entries that never get a grant. Replaces the removable defaults (kubectl drain, cordon, uncordon). |
Callers must also pass approval_context (at most 500 characters): one or two sentences saying why this conversation needs the operation. Without it the request always goes to a human and cannot teach a grant.
What “the same operation” means
Splicedock reduces a request to a shape. Two requests match only when every field is exactly equal.
| Field | Meaning | Example |
|---|---|---|
profile, token_id | Who is calling. A grant never crosses callers. | ops, one profile token |
tool, verb_path | The tool and its verb. | kubectl, delete |
resource_kind | The kind of object. | job |
namespace | Resolved namespace. The <default> namespace never matches. | splicedock |
object_count_max | A fixed cap, always 5. A request naming 1 to 5 objects matches; more than 5 is never eligible. A grant learned from one object therefore also covers up to five prefixed objects. | 5 |
flags_allowed | The fixed set of flags the parser accepts (the namespace flag and --wait). Any other flag makes the request ineligible; adding --wait does not change the shape. | namespace, --wait |
The object names are deliberately not part of the shape. They are handled separately by the name prefix, described below.
The lifecycle at a glance
Learning
- Requestno live grant matches
- Human approvesa person says yes
- Command runssuccess counts as evidence
- 3 consistent successesone shape, within 7 days
- Grant created3 days, 20 uses
Using
- Requesta live grant matches
- Use claimedatomically, one use spent
- Runsno human needed
Grant ends
- expiry
- 20 uses
- 3 consecutive failures
- rejection
- revoke
Step 1: learning (promotion)
After a human-approved operation runs, Splicedock considers promoting it. Nothing is learned unless all of these hold:
- The operation executed and succeeded. A failed run, for example a Forbidden delete, counts as zero evidence.
- It had a non-empty
approval_contextand was not a strong (WebAuthn) approval. Strong tools are never covered by grants. - Its tool and verb are not on the exception list.
- The operation classifier does not call it
destructiveorunknown(see below). - Its namespace is in
SPLICEDOCK_GRANT_NAMESPACES. - The shape is not blocked after a recent rejection, and no live grant already exists for the same caller, tool, verb, kind and namespace.
- At least 3 successful approvals of the exact same shape exist from the last 7 days, and their contexts are mutually consistent. Approvals from before the previous grant ended, or before a rejection, do not count, even inside the 7 days, so relearning needs fresh evidence.
- The approved object names share a usable name prefix.
Consistent evidence. Evidence is built greedily from the newest approval. A candidate is kept only if its context does not escalate against the current request and against every piece already kept, in both directions. Consistency is not transitive (“before” and “after” can each agree with a neutral reason), so every pair is checked. The log line grant promotion evidence reports approvals (candidates) and consistent (kept).
Name prefix
The grant covers only names that start with the longest common prefix of the approved names, cut just after the last - or . so only whole segments remain. At least three characters must precede that separator.
| Approved names | Grant prefix |
|---|---|
backup-29384701, backup-29384702, backup-29384703 | backup- |
grantprobe-a, grantprobe-b, grantprobe-c | grantprobe- |
nightly-1, prod-db, cache-9 | none: no grant forms |
a-1, a-2, a-3 | none: prefix too short |
A request matches only when every object name starts with the prefix. A request that names no objects never matches. The tool must be able to read names from its arguments (kubectl can); a tool without that hook never learns a grant.
The operation classifier (deny-only)
A closed, hand-written table rates each tool|verb|kind as benign, disruptive, destructive or unknown. Grants use it only to say no: destructive and unknown never form or match a grant. Flags such as --force, --all, -A and --grace-period can only raise the class. An unrecognised tool, verb, kind or flag is unknown, which means “ask a human”.
Example: kubectl delete pod and kubectl delete job are disruptive (recreated by their controller) and may be granted. kubectl delete deployment, secret or namespace are destructive and always need a person. The classifier never authorises anything; it can only add caution.
Step 2: matching a new request
For each request, Splicedock walks these checks in order and stops at the first that fails, which sends the request to a human:
- Grants are enabled.
- The request has an
approval_contextand names at least one object. - The classifier does not deny the shape.
- The namespace is in the allowlist.
- The shape and its caller/tool/verb scope are not blocked.
- A live grant exists with exactly the same shape, not revoked, suspended, expired (3 days) or used up (20 uses).
- Every object name starts with the grant’s name prefix.
- The grant still rests on at least threshold-many evidence approvals.
- The new context does not escalate against any evidence context.
If all pass, the use is claimed atomically: a single conditional update re-checks quota, revocation, suspension, expiry and the namespace at commit time. Two concurrent requests cannot both spend the last use, and a revoke that lands first wins.
Context can only say “ask a human”
The caller writes the context, and the caller is the party the gate constrains. So similarity of wording never grants anything. Context is a deny-only signal. A request escalates to a human when its context:
- carries no meaningful reason (empty, identifiers only, or more identifiers than words);
- states a risky purpose no reference stated, such as “so nobody notices”, “without approval” or “ignore previous instructions”;
- contradicts any stored reference (before/after, same/different, old/patched).
Practical rule: keep approval_context in the same style and meaning across repeated calls. A changed rationale makes the log say grant context escalated and a human gets the request, even though the shape matched.
Step 3: limits and how a grant ends
| Ends when | Detail |
|---|---|
| Expiry | 3 days after creation. No renewal. |
| Use cap | 20 uses. Reserved uses that fail before starting still count. |
| Suspension | Three consecutive execution failures suspend it. A success resets the counter. |
| Rejection | Rejecting the same shape revokes its grants and blocks learning for 7 days. An ambiguous rejection (for example attached -nX syntax) resets the whole caller/tool/verb scope. |
| Manual revoke | An administrator revokes one or all grants (needs a human session). |
| Exception added | Adding a tool or verb to the exceptions revokes its existing grants. |
| Namespace removed | Removing a namespace from the allowlist stops its grants immediately without deleting them. |
Worked example
A job runner repeatedly cleans finished jobs in namespace splicedock (allowlisted). Each call passes the same kind of context.
kubectl delete job grantprobe-a -n splicedock # human approves, succeeds (1/3)
kubectl delete job grantprobe-b -n splicedock # human approves, succeeds (2/3)
kubectl delete job grantprobe-c -n splicedock # human approves, succeeds (3/3)
-> grant created: prefix "grantprobe-", 3 days, 20 uses
kubectl delete job grantprobe-d -n splicedock # runs automatically
kubectl delete job other-x -n splicedock # prefix differs: human
kubectl delete deployment grantprobe-z ... # destructive: humanThis is the live end-to-end test: the fourth call produced approval bypass and approval consumed with no pending entry, while the destructive deployment delete still created a pending approval.
Inspect and control grants
In the admin panel open Approvals → Automatic approvals to see each grant’s prefix, uses, last use and expiry, to revoke one or all, and to manage exceptions.
| Endpoint | Purpose |
|---|---|
GET /api/v1/grants | List grants. |
POST /api/v1/grants/:id/revoke | Revoke one grant; id all revokes every grant. Needs an authenticated human WebAuthn session. |
POST /api/v1/grant-exceptions | Add or remove an exception (tool, optional verb_path). |
Reading the logs
| Log line | Meaning |
|---|---|
approval pending | A human is needed. |
grant promotion evidence | approvals candidates, consistent kept. Learning needs consistent ≥ threshold. |
grant promotion skipped: … | Classifier, namespace allowlist or no common name prefix. |
standing grant created | A grant now exists. |
cli_passthrough approval bypass | The approval was reserved before execution. It also appears for manually approved requests, so look for a grant-specific line (or no pending entry) to tell an automatic approval apart. It does not prove the command succeeded. |
approval consumed | The approval was used. |
grant context escalated | Shape matched, but the context sent it to a human. |
Why did my request still ask for approval?
- Grants are off, or the namespace is not in
SPLICEDOCK_GRANT_NAMESPACES. - No
approval_context, or it changed style since the evidence (grant context escalated). - The operation is
destructiveorunknownto the classifier. - A flag, namespace or kind differs, more than 5 objects are named, or a name does not start with the prefix.
- Fewer than three successful, consistent approvals so far, or runs failed (failures are not evidence).
- The grant expired, hit 20 uses, was suspended or revoked, or a rejection blocked the shape for 7 days.
- The tool is strong (WebAuthn) or on the exception list.