İçeriğe geç

Dokümantasyon İngilizcedir.

Approvals of high-risk actions

Agents work inside a disposable git worktree and an OS sandbox, and every tool call they make passes the policy engine first. The engine parses shell commands with tree-sitter and classifies each call:

RiskExamplesDecision
LOWreading files, git status, ls, lintersallowed
MEDIUMbuilds, tests, package installs, local git commits, file edits in the worktreeallowed
HIGHgit push, changing git remotes or credentials config, gh/glab writes, publishing packages, docker push/login, ssh/scp, uploads or authenticated requests with curl, reads outside the readable paths, writes outside the worktreedenied, or an approval request
CRITICALsudo, broad rm -rf, terraform apply, kubectl/helm changes, force pushes, curl … | sh, reading credential filesalways denied

Whether a HIGH call is denied or turned into an approval request is a setting of the agent's policy profile (approvals.high: deny | ask). The bundled profiles:

ProfileAgentsHIGH
dev-standardbackend-developer, frontend-developer, qadeny
readonly, researcharchitect, code-reviewer, analyst, triage, researcherdeny
devops-plan-onlydevopsask

Pushing is never something to approve in issue work: meiksense pushes meik/* branches itself, outside the sandbox, after the gates passed. Approvals are for the rare action an agent cannot do without, typically with the devops agent or a custom profile.

What happens

  1. A HIGH call under approvals.high: ask is not run. meiksense files an approval request A-<n> (tool, exact request, risk, reasons) and tells the agent: "This HIGH-risk action needs human approval … An approval request has been filed. Do not retry it now; continue with the rest of the work."
  2. The agent finishes what it can. When its run ends with pending requests, meiksense saves its work (a checkpoint commit "wip before approval" and its handoff) and the task waits in AWAITING_APPROVAL. Nothing prompts you in the middle of a run.
  3. An issue whose task waits stays in its current state (DEVELOPING, or FIXING_PIPELINE / ADDRESSING_REVIEW for a fix) until the decision. There is no Slack event for pending approvals in this release: watch the approvals page or meik approvals.
  4. When no request of the task is pending any more, the paused stage resumes the same agent session with the note "Resuming after human approval". An approved request is allowed exactly as it was written; a denied one comes back to the agent as "human denied …", and it has to find another way.

Every denied call counts toward the profile's approvals.max_denials (default 8) per run; above it, or after two CRITICAL attempts, the run is stopped and the task is BLOCKED.

In plain words

Every request comes with one plain sentence above the command, in the reader's language (English or Azerbaijani), for example:

The assistant wants to read “release notes” from api.example.com, signed in with an access key (not on the list of approved sites) — allow?

The assistant's reason: “Check the library's latest version before upgrading it”

  • The sentence is built from the request itself: what kind of action (a call to a site, downloading and running a script, installing or publishing a package, uploading code with git push, connecting to a server, changing, deleting or opening a file, a web search, another program or tool), the site, method, file or package, whether credentials are sent, and whether the site is outside the sandbox's allowed network domains (sandbox.network_domains plus the repositories' network_domains). Further commands of the same request are counted ("and 2 more steps").
  • The assistant's reason is the description the agent gave its tool call (Claude Code's and Codex's Bash description, WebFetch's prompt). It is the agent's own text: control characters removed, secrets redacted, capped at 300 characters, and shown as plain text. Requests filed before this release, and calls without a description, show no reason.
  • The sentence is presentation only. It never changes the decision: the policy engine classifies the exact request on its own, and an approval allows exactly the request shown under the sentence. Read the command when it matters.
  • In the simple view (product owners, or anyone who switched it on) the card shows the sentence, the reason and the buttons; the command, risk, tool, task and the policy's reasons are folded under Technical details. The developer view shows the sentence above the unchanged technical card.
  • The API returns the facts behind the sentence as plain (action, host, method, subject, signedIn, outsideAllowlist, path, package, manager, registry, program, remote, query, purpose, more) and the stored reason as purpose, on GET /api/v1/approvals and on each approval of GET /api/v1/tasks/{task}.
  • A link /approvals?id=7 (or ?id=A-7) scrolls to that request and highlights it for two seconds; the dashboard's approval rows link there.

Deciding

WhereListApproveDeny
CLImeik approvals [-a]meik approve A-7 [--remember] [--note "…"]meik deny A-7 [--note "…"]
Web UIthe approvals and task pages (UI tour)approve, optionally remembereddeny
APIGET /api/v1/approvals?status=pending|approved|denied|all&task=T-12POST /api/v1/approvals/A-7/approve { "remember": true, "note": "…" }POST /api/v1/approvals/A-7/deny { "note": "…" }
  • Remember (--remember, "remember": true) also allows this exact request for the whole project from now on (remembered_rules). It never lowers CRITICAL calls, and a request that differs in any character is asked again.

  • Approval ids accept A-7, a7 or 7. Only pending requests can be decided (409 otherwise).

  • Who may decide: in service mode the roles maintainer (of the task's project) and admin (approval.decide); every role can read them. Every decision is audited (approval.approve, approval.deny).

  • Product owners (role po) hold approval.decide in their projects, but HIGH-risk tool approvals (every approval today) go to maintainers and admins unless the global setting ui.po_tool_approvals is true:

    ui:
      po_tool_approvals: true   # default false
    

    Off (the default), a user whose roles are all po does not see these requests on the approvals page or in GET /api/v1/approvals, and deciding one answers 403. On, she sees the requests of her projects and may decide them like a maintainer. Each list item carries canDecide for the signed-in user.

  • In service mode meik approvals, meik approve and meik deny go through the API once you ran meik login (or set MEIK_API_URL and MEIK_API_TOKEN), with your RBAC and an audit entry; the list shows each task's project (--json for scripts).

Trying the policy

meik policy check "git push origin HEAD"                 # → HIGH, with the reasons and the message the agent sees
meik policy check "terraform apply" --agent devops
curl -X POST "$MEIK_URL/api/v1/policy/check" -H "Authorization: Bearer $MEIK_TOKEN" \
  -H 'content-type: application/json' -d '{ "command": "git push origin HEAD", "agent": "devops" }'

Policy profiles are YAML (defaults/policies/*.yaml; overrides in ~/.meiksense/policies/ or, in service mode, as definitions through the API / web UI). The security guide describes the classifier, the floor rules profiles cannot lower, and the sandbox.