Skip to main content
For MSPs

Agent rules

Agent rules decide what AI agents may do in your connected tools. A rule can allow a call, hold it until an administrator approves it, or block it. You write them once for your own organization, try…

Written By Christopher Scaminaci

Last updated 16 days ago

Agent rules decide what AI agents may do in your connected tools. A rule can allow a call, hold it until an administrator approves it, or block it. You write them once for your own organization, try them in Test mode, and make them Live when you are sure.

At a glance

  • What it does: refuses or holds an AI agent's call to a connected tool (for example "no destructive Halo tool without approval") before the tool runs.
  • Plan: Free has no agent rules. Pro writes rules in Test mode: they record what they would have done. Business and higher make rules Live.
  • Who: an Administrator. Approving a held call also needs a second factor.
  • Where: AI Governance → Rules → Agent rules.

What a rule says

Each rule has five parts:

  • Which tools. All tools, destructive tools, tools that change something, one category of a connector, or named tools. A connector is optional (empty means every connector); a category or a list of names needs one.
  • Where. Every connection and every endpoint, or only the connections and endpoints you tick. An endpoint is the way the agent reached StackJack: an API credential you made for a customer, a client signed in by its address, a registered client such as a Copilot Studio connection, or Microsoft 365 Copilot. The picker lists the ones StackJack has seen in the last 30 days.
  • Who. People, automations, or both.
  • Action. Allow, Require approval or Block.
  • Mode. Test or Live.

When several rules match one call, the most specific wins: named tools beat a category, a category beats destructive or write tools, those beat all tools, and a rule that names a connection or an endpoint beats one that does not. When two are equally specific, the strictest wins (Block, then Require approval, then Allow). Allow exists to carve an exception out of a broader rule, for example "allow read-only tools for the Acme connection" under "block everything".

Try it in Test mode first

A rule starts in Test mode. A Test rule never refuses anything: it counts the calls it would have blocked or held, and the page shows "Would have blocked or held N calls in the last 7 days." On Pro, every rule is a Test rule. If you want a daily message about it, point an alert policy at Agent rules acted on AI calls; it says how many calls, never which rule or tool.

Make a rule Live

On Business and higher, open a rule and select Make live. The dialog states in one sentence exactly what the rule will block or hold. You then type ENFORCE RULE to confirm. A rule that blocks every tool of every connector for everyone shows a stronger warning first. A Live rule acts on every matching call within about a minute of being saved.

If your plan drops from Business to Pro, your Live rules act as Test rules within a minute. Nothing is deleted.

What an agent sees

A blocked call answers: "This call was refused by your organization's agent rule "Name" (AI Governance): the tool on the connector is not allowed from this endpoint." The agent is told to ask an administrator to change the rule or to use a different tool. A call a rule holds answers: "Your organization's agent rule "Name" requires approval for this call. Approval request is waiting." A refused call is not counted against your monthly usage.

Require approval

  1. The agent's call is refused and StackJack records one waiting request for it (it waits up to 60 minutes).
  2. An administrator opens the request from the Agent rules page, or from the Teams card, and selects Approve or Reject. You do not type a phrase for one call, and a second factor is required.
  3. After an approval, the agent repeats the same call with the same arguments within 15 minutes. StackJack lets that one call through, once. A different call, or the same call a second time, needs a new approval.

StackJack keeps a fingerprint of the call's arguments to match the repeat. It does not keep the arguments. The agent can check the state of a request with aigov_get_reach_approval before it repeats the call.

A person may not approve a call they made themselves, unless they are the only administrator. An automation cannot wait for an approval, so a Require approval rule blocks an automation's call, and the message points to the automation's own destructive-consent setting.

Teams

When a call is held, the Teams app posts a notice card with the tool, the connector, the rule and the kind of connection, and one button, Review in StackJack. Teams never approves a held call: an approval needs a second factor, which a click on a card does not carry. The card changes to "Approved", "Rejected", "Expired" or "Approved and used". "Approved and used" means the retried call took the approval; another check can still refuse that call, so it does not promise the call succeeded.

From your AI assistant

An AI assistant connected to StackJack can list the rules and their counts (aigov_list_reach_rules), read the state of a held call (aigov_get_reach_approval) and propose a rule (aigov_propose_reach_rule). A proposed rule is always stored in Test mode, and the page shows it with "Proposed by an AI tool" until an administrator makes it live here. An assistant cannot make a rule Live. If a rule is changed by a person in the Portal, it is theirs from then on.

What agent rules do not cover

Agent rules apply to the calls AI agents make to your connected tools (Halo, NinjaOne, ConnectWise and the rest). They do not apply to StackJack's own tools: the AI Governance tools, the platform tools and the tools that build automations. That is on purpose, so a rule can never stop you from changing the rules.

If anything goes wrong inside the rule check, StackJack lets the call through: a problem in AI Governance never stops your tools from working. StackJack can also switch enforcement off for a whole region, in which case every rule only records; the Agent rules page then shows "Enforcement is switched off for this region: every rule only records."

Limits

  • 50 rules for your account. A rule's name is 1 to 120 characters and must be unique.
  • A rule names up to 50 connections and 20 endpoints. A named-tools rule lists up to 200 tools.
  • Counts are kept 90 days. A waiting request is kept 60 minutes; an approval can be used for 15.
  • Agent rules belong to your own organization. A client organization cannot have its own.

What is recorded

Creating, changing, making live and deleting a rule, and each request, approval and rejection, are in the audit trail with ids only. The trail never holds a rule's name, an argument or a person's name.