Skip to content
Open Source AI Employee

An open-source AI agent approval workflow is a file you write

An AI agent approval workflow decides which tool calls run, which wait for a person, and which are refused. My pick is Kortix, the open-source CompanyOS, where the workflow takes the form of a file: a policy: block in the project manifest whose default mode is allow_all, and I'm part of the Kortix team, so weigh that accordingly.

The policy, the rules and the hold, as the manifest reference prints them

kortix.yaml
policy:  default_mode: riskpolicies:  - match: gmail.send_email    action: require_approval    conditions:      - arg: to        match: "*@example.com"     # a glob, or /regex/ in slashes  - match: gmail.send_email    action: blockapprovals:  ttl: 4h
Source: https://kortix.com/docs/project/manifest

One mode for unmatched calls, one rule that holds an email to a recipient matching *@example.com, one rule that blocks the send, and a four-hour wait for a decision.

What a gate decides about one call

Every connector call an agent makes carries two names: the connector and the tool. gmail.send_email is a send through the Gmail connector. Kortix matches connector policy on that pair, the fully qualified tool path in the manifest reference, so a rule can hold the send without touching the agent's ability to read the inbox. Work inside the session's sandbox, such as reading a file, running a command or searching the repo, is not a connector call, and a command run there can reach an outside API without passing through connector policy.

A rule has three actions. always_run runs the call. block refuses it, whatever the arguments say. require_approval holds it: the session pauses at that point, a person decides, and the call resumes with the same arguments after the approval. A company can hand an AI employee a real tool and keep the calls that matter behind a person, because the rule is matched against the call itself.

The hold has a clock on it. approvals.ttl takes an integer and a unit of m, h or d, so 30m, 4h and 7d are valid, and Kortix clamps the value between 5 minutes and 30 days. A held call that nobody decides in that window expires. Without the key, the wait is 24 hours (Read the docs).

The default mode decides whether a review happens

policy.default_mode takes two values, allow_all and risk, and Kortix's manifest reference lists allow_all as the default. A project whose manifest has no policy: block therefore runs every connector call that no rule matches. Setting the mode to risk changes the answer for those unmatched calls: a read runs, and a write or a destructive call needs approval. Approval gates you set. Off until you set them.

The published designs around approvals put the gate in a configuration step too. Microsoft documents multistage approvals as an action a maker adds to an agent flow, with manual stages and AI stages (Microsoft Learn). WorkOS's Airlock walkthrough configures email rules in a Rule Builder, then evaluates each agent call against them (WorkOS). In each case the gate is a rule someone writes, and the product decides what happens to a call before the first rule exists.

Rules a reviewer can diff

policy: and policies: live in kortix.yaml at the repository root, next to agents:, so a rule change arrives as a diff against the rule it replaces. The reviewer reads the match and the action on the changed lines, and the file history answers who changed it and when.

Order matters. Kortix checks the project's policies: list first, then the connector's own policies, and the first rule that matches wins. Two rules for one tool read as a sequence, so a rule placed before an older one changes the outcome without editing the older rule.

A match is a glob over the tool path, gmail.* for every Gmail tool, or the exact path for one. conditions narrows a rule to calls whose arguments fit: arg: to with a glob such as *@example.com, or a regular expression between slashes, and negate: true flips one condition. Every condition on a rule must hold for the rule to apply. The example holds an email whose recipient matches *@example.com for approval; the following rule blocks other Gmail sends. That is the intent an auditor tests.

kortix validate checks the manifest and not the policy. A malformed rule is skipped when connectors sync, and the sync reports it as an error, which is why the rules get a second read in the connector settings after the merge.

The change reaches the project the way other work does. Session work reaches main through a change request. Merge is default-deny for agents. A policy edit is reviewed beside the work that motivated it, and a revert puts the old rule back.

The five steps that write the file

  1. Copy the policy: block into kortix.yaml and set default_mode: risk so unmatched writes stop for a person.
  2. Add a policies: entry for the tool that matters, with action: require_approval.
  3. Add a conditions: entry for the argument that decides the call, such as the recipient of an email.
  4. Open a change request and read the diff before it merges.
  5. After the merge, check the rules in the connector settings, where a skipped rule shows up as a sync error.

What the approver sees

An approval card is worth reading only if it carries the facts of the call. The prompt names the connector action and shows the arguments the agent passed, with credential-shaped values redacted, and it offers one decision for that one call.

Approval is a permission, held by the people who manage the project. The decision lands in the same record as the rest of the session. Every action is recorded. Reading, exporting and streaming the audit log depend on the plan.

Questions about approval gates

Short answers, kept next to the file that holds them.

An agent workflow is a loop: read the task, call a tool, check the result, repeat until the job is done. A person joins at the calls a policy marks for approval, and the run resumes after the decision.

An approval workflow is a set of rules that holds a specific action until a person decides it. In Kortix the rules sit in policies: in kortix.yaml, and a held connector call waits 24 hours before it expires unless approvals.ttl says otherwise.

The five are instructions, a model, the tools it can call, the context it works from, and the policy that governs those calls. Kortix keeps the instructions, the tool grants and the policy as files in the project repo.

Put the gate in a file a reviewer can read

Start with the default mode, then add one rule for the call that matters.

Open source · Self-host is free · 3,000+ apps in a click