Search the documentation
Search the documentation...
SplitSecure documentation

On this page

Procedure · 2 steps

Write a policy

The policy language: name people and groups, combine them, ask in order, escalate on a timer or branch on the request, then save the policy and give its name to the developer.

Updated

Before you start

  • Administrator access to the SplitSecure organization, with a seat that includes StepAuth policies.

A policy decides who must approve, in what combination, and within what time. For example, Acme can require the IT lead and one member of the security group before a laptop wipe.

The policy language

A policy is one expression. The hub reads it from the outside in and asks the people it names. The request is approved when the expression is satisfied, and denied when no path can succeed any more.

Name who approves

Form Meaning
(person "a@acme.example.com") The person with this email approves.
(group "name") Any one member of the group approves.
(group "name" 3) Three distinct members of the group approve.
(group "name" "pool") A group from an identity pool, named with its pool.
(initiating-party) The person or group that started the request approves. When the request names no active member of the organization as its initiator, a service account or a suspended or unknown person for example, this step passes with no approval, and it adds no approver to (at-least N ...).
(policy "name") The stored policy of the organization with this name is satisfied.
(person-id "s2r"), (group-id "s2r"), (policy-id "s2r") The same, by id. An id keeps pointing at the entity after a rename. Copy on the member’s page, the group row or the policy page gives it.

Each organization has the groups Everyone, Owners, Admins, Members and Auditors. Everyone holds the members who are active with a role and a seat. Each role group holds the active members with exactly that role and a seat. Name them like any other group, as in (group "Admins" 2).

A group is fixed at submit to its members who hold a seat at that time. A person counted through it must still be in the group when they decide, or, for a role group, have held its role since submit. A person who joins after submit cannot approve through it. Service accounts never approve, in any group.

A group that cannot meet its quorum fails its branch as soon as the request is submitted, before anyone is asked. The request is denied when no other path can succeed.

An approval already recorded is not checked again. An approval given before a later demotion, suspension or seat loss still counts.

A submit that names Everyone is refused with approver_set_too_large when the organization has no role counts, or when it counts more than 5000 members. A role group that holds more than 5000 members is refused the same way.

Every approver must hold a seat. The owner always counts as seated, and in an organization with seats off every member does.

The names Everyone, Owners, Admins, Members and Auditors are refused on group create and rename. A group that already held Owners, Admins, Members or Auditors keeps it, and then a bare (group "Admins") names that group while (group-id "s2r") names the role group.

The requester counts as an approver too, so use (at-least 2 ...) to require a second person.

When you save, the hub also stores a copy of the policy with every name and email pinned to its id form. Your source stays as you typed it. A reference that does not resolve refuses the save.

Combine approvers

Form Meaning
(or expr...) At least one child is satisfied.
(and expr...) Every child is satisfied.
(any N expr...) At least N of the children are satisfied.
(at-least N expr) The expression is satisfied, and at least N different approvers approved inside it. A person who satisfies several branches counts once. Every :approve inside counts as one approver, the policy, so to require N people, use only people and groups inside.
(seq expr...) Every child is satisfied, in order. The hub asks the next child only after the previous one is satisfied.
(timeout "10m" now after) The now child can be satisfied at any time. After the duration passes, the after child can be satisfied too. The clock starts when the hub first asks this part.
(def-policy name expr) Gives a name to an expression, at the top level of the source. (name) uses it, before or after the definition. A name starts with a lowercase letter and holds lowercase letters, digits and single hyphens. It cannot be the name of a form.
:approve Satisfied as soon as the hub reaches it, and nobody is asked. Use it only in a branch whose test reads values the requester cannot choose.
:deny Never satisfied. Inside or, only its own branch fails.

A deny makes its branch unsatisfiable. The request is denied when no path can succeed.

Branch on the request

A conditional picks one branch from the service provider that signed the request, the action’s name, its category and effect flags, and the request’s details. The hub picks the branch once, before it asks anyone, and records it on the request.

Form Takes
(if test then else) then when the test is true, else else.
(when test expr) expr when the test is true. Otherwise the branch is never satisfied.
(cond test expr ... :else expr) The branch of the first true test, else the :else branch. :else is required.
(case fact key expr ... default) The branch whose key equals the fact, else the default, which is required. A key is a string, a number or a set such as #{"data.read" "data.export"}.

A test reads facts and compares them:

Test True when
(= a b), (not= a b) The values are equal, or differ. Text compares exactly, case included.
(< a b ...), (<= a b ...), (> a b ...), (>= a b ...) Each number is in that order with the next. (< 100 x 10000) is true when x is more than 100 and less than 10000.
(contains? #{"a" "b"} value) The set holds the value.
(starts-with? value "prefix") The value starts with the prefix.
(and test...), (or test...), (not test) Every test, any test, or not the test is true.
Fact Value
(sp) The entity of the service provider that sent the request, as its metadata gives it, such as acme.example.com. It is not the display name.
(action-name), (action-category) The action’s name and category. An action with no category reads as empty text.
(action-read-only?) A test: the action is marked read-only, as described below.
(action-destructive?) A test: the action is marked destructive, as described below.
(detail "key") The detail at this key, such as device.serial: its id, else its value. A quantity reads through (quantity ...) only.
(quantity "key" "unit") The detail at this key as a number, when the schema declares it as a quantity, its value is a plain decimal and its unit is this one. Otherwise the request has no value for it.

(action-read-only?) and (action-destructive?) are tests, so write them where a test goes, with no = true. They are not facts for case. Neither test ever denies a request as missing. An action can be neither, so give the stricter branch to :else.

The sender declares both flags in its schema. The hub takes the flags from the schema version the request names, and never from the request. It does not check them against what the action does:

  • A service provider declares them on each action of its schema. An action that the schema marks with neither flag reads false for both.
  • An MCP gateway composes the schema of its tools. When a translator describes the tool, each action takes each flag from the translator’s schema, else from the tool’s annotations, else the MCP default. A read-only action is never destructive. A flag the translator states beats an opposite flag in the annotations. For any other tool, the annotations alone set the flags. A tool’s annotations apply to every action of that tool. The gateway reads the annotations that the upstream server last listed, and the server can change them between calls.
  • Where the annotations set the flags, readOnlyHint: true makes the action read-only, and so not destructive, even when the tool states destructiveHint: true. Otherwise destructiveHint: false makes it not destructive. A hint that is not a boolean counts as absent. With no flag from any source, an action is destructive. A tool that no translator describes, with no annotations or none captured yet, is destructive.
  • A held call that a translator describes as several actions sends one request. The gateway picks the action that the request names, and the hub does not check the choice. The request takes that action’s flags. Its category is the one of the rule that matches the action, else the translator’s, else data.read, so a gateway action always has a category. Do not give data.read a lighter branch for a gateway.
  • The action with the strongest effect governs: deny, then StepAuth, then allow. Among actions with the same effect, a destructive action governs, then an action that is not read-only, then an action that a rule matches over one that falls to the gateway’s default policy, then the first one. So a request names a read-only action for a call that also holds a destructive action only when an allow rule covers the destructive action.
  • The gateway refuses a call with an action that the translator’s schema does not declare.

A policy that approves with nobody asked trusts the flags. A service provider sets them in its schema. SplitSecure ships the translators inside the gateway, and a gateway runs no other translator. A translator action that leaves a flag out takes it from the tool’s annotations, so the upstream MCP server sets that flag, for a delete action too. The upstream server sets the flags for every other tool. Unless you control whoever sets them, ask a person on every branch.

When a test that the hub evaluates reads a detail or a quantity that the request lacks, the hub denies the request. A test in a branch the request does not take reads nothing.

A default reads an optional value: (detail "key" "none") or (quantity "amount" "usd" 0). A default also applies when the unit differs, or when the hub cannot read the detail as a quantity. Give a default only when it leads to the stricter branch.

The hub reads only the details that the schema declares as an id or a quantity: text details stay out, because the requester writes them. A request sent without a schema reads every detail as an id. The hub reads the first 128 details, to four levels.

Examples

Any member of group a approves, or one named person:

(or (group "a") (person "b@acme.example.com"))

Three members of group a or one named person, and in both cases a second person:

(and
  (or (group "a" 3) (person "b@acme.example.com"))
  (person "c@acme.example.com"))

Ask one person first, and the others only after that person approves:

(seq
  (person "c@acme.example.com")
  (or (group "a" 3) (person "b@acme.example.com")))

Page the on-call person, and let any manager approve after ten minutes:

(timeout "10m"
  (person "oncall@acme.example.com")
  (group "managers"))

Two different people, even when one person could satisfy both parts:

(at-least 2
  (and (group "b") (person "foo@acme.example.com")))

A named branch reused by the main expression:

(def-policy risk-review
  (or (group "a" 3) (person "b@acme.example.com")))

(and (risk-review) (person "c@acme.example.com"))

Large transfers need finance and an owner, exports need IT, and everything else needs two IT approvers. A transfer with no amount in USD is denied. One person who is in finance and is an owner satisfies both parts of the and, so wrap the pair in (at-least 2 ...) to require two people:

(case (action-category)
  "financial.transfer"
    (if (> (quantity "amount" "usd") 10000)
      (and (group "finance") (group "Owners"))
      (group "finance"))
  #{"data.read" "data.export"} (group "it-approvers")
  (group "it-approvers" 2))

A request whose action is read-only needs one approver. Any other request needs two, so a missing flag never takes the lighter branch. An MCP call with several actions is one request with the flags of its governing action:

(cond
  (action-read-only?) (group "it-approvers")
  :else               (group "it-approvers" 2))

The person who started the request, plus a manager:

(and (initiating-party) (group "managers"))

Save the policy

In the Web App

  1. In the sidebar, click StepAuth → Policies.
  2. Click Create policy.
  3. In Policy name (unique, permanent), enter a name, for example laptop-wipe.
  4. Write the policy in the editor. The Reference tab lists the forms of the policy language.
  5. Click Save.

A name has 64 characters or fewer, and you cannot rename a policy later. An organization has 200 policies or fewer.

The developer passes the policy name, laptop-wipe, to the policy helper of the SDK. The hub directory also lists the names of the policies. The Policy S2R field on the policy page copies the id that other policies reference. A request can also name the policy by this id. The id never names a policy that someone creates later under the same name.