SplicedockUSER DOCUMENTATIONGitHub
Contents
USER GUIDE

Approve once, repeat safely.

How Splicedock learns, matches, limits and revokes standing grants.

On this page

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

SettingEffect
SPLICEDOCK_GRANTS=1Enables learning and matching. Default: off.
SPLICEDOCK_GRANT_NAMESPACESComma-separated exact namespaces where grants may form and match. Default-deny: empty means grants are effectively off.
SPLICEDOCK_GRANT_THRESHOLDSuccessful, consistent approvals needed to learn a grant. Default 3.
SPLICEDOCK_GRANT_EXCEPTIONSJSON 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.

FieldMeaningExample
profile, token_idWho is calling. A grant never crosses callers.ops, one profile token
tool, verb_pathThe tool and its verb.kubectl, delete
resource_kindThe kind of object.job
namespaceResolved namespace. The <default> namespace never matches.splicedock
object_count_maxA 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_allowedThe 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

  1. Requestno live grant matches
  2. Human approvesa person says yes
  3. Command runssuccess counts as evidence
  4. 3 consistent successesone shape, within 7 days
  5. Grant created3 days, 20 uses

Using

  1. Requesta live grant matches
  2. Use claimedatomically, one use spent
  3. 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:

  1. The operation executed and succeeded. A failed run, for example a Forbidden delete, counts as zero evidence.
  2. It had a non-empty approval_context and was not a strong (WebAuthn) approval. Strong tools are never covered by grants.
  3. Its tool and verb are not on the exception list.
  4. The operation classifier does not call it destructive or unknown (see below).
  5. Its namespace is in SPLICEDOCK_GRANT_NAMESPACES.
  6. The shape is not blocked after a recent rejection, and no live grant already exists for the same caller, tool, verb, kind and namespace.
  7. 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.
  8. 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 namesGrant prefix
backup-29384701, backup-29384702, backup-29384703backup-
grantprobe-a, grantprobe-b, grantprobe-cgrantprobe-
nightly-1, prod-db, cache-9none: no grant forms
a-1, a-2, a-3none: 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:

  1. Grants are enabled.
  2. The request has an approval_context and names at least one object.
  3. The classifier does not deny the shape.
  4. The namespace is in the allowlist.
  5. The shape and its caller/tool/verb scope are not blocked.
  6. A live grant exists with exactly the same shape, not revoked, suspended, expired (3 days) or used up (20 uses).
  7. Every object name starts with the grant’s name prefix.
  8. The grant still rests on at least threshold-many evidence approvals.
  9. 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 whenDetail
Expiry3 days after creation. No renewal.
Use cap20 uses. Reserved uses that fail before starting still count.
SuspensionThree consecutive execution failures suspend it. A success resets the counter.
RejectionRejecting 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 revokeAn administrator revokes one or all grants (needs a human session).
Exception addedAdding a tool or verb to the exceptions revokes its existing grants.
Namespace removedRemoving 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.

Three approvals, then automatic
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: human

This 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.

EndpointPurpose
GET /api/v1/grantsList grants.
POST /api/v1/grants/:id/revokeRevoke one grant; id all revokes every grant. Needs an authenticated human WebAuthn session.
POST /api/v1/grant-exceptionsAdd or remove an exception (tool, optional verb_path).

Reading the logs

Log lineMeaning
approval pendingA human is needed.
grant promotion evidenceapprovals candidates, consistent kept. Learning needs consistent ≥ threshold.
grant promotion skipped: …Classifier, namespace allowlist or no common name prefix.
standing grant createdA grant now exists.
cli_passthrough approval bypassThe 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 consumedThe approval was used.
grant context escalatedShape 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 destructive or unknown to 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.