For developers · MCP server and API

Agent Rules: AI agents ask the owner first

Envorn Agent Rules is a remote Model Context Protocol server and a simple HTTP API. Before an AI agent spends money, gives a refund or discount, commits to a customer or does anything unusual for a business, it asks. The answer comes from rules the business owner wrote in plain English, with money limits checked by code, and anything unclear waits in the owner's inbox.

Why it exists

Agents that can act need limits, and small businesses don't have a policy engine or a governance team. With Agent Rules the owner writes rules the way they'd tell a new employee ("Anyone can refund up to $50 if the customer is unhappy; over $50 comes to me"), and the same rules answer their staff's questions and their AI agents' requests. Every decision is recorded with the rule that was used, so the owner can see what happened and adjust.

How a check works

  1. The agent calls check_permission with the action, the amount in U.S. dollars (if any) and short context.
  2. Envorn reads the owner's rules, works out which rule applies and the amount involved, and checks the amount against the rule's limit in code, not by AI judgement.
  3. It answers allow, deny or needs_approval, with the reason and the rules it used. Anything the rules don't clearly cover becomes needs_approval and goes to the owner.
  4. For needs_approval, the agent waits and calls get_decision later (or polls the status_url) to see whether the owner approved or denied it. Agents must never act on needs_approval or deny.

Connect an agent

The business owner creates a key for each agent in Envorn under Ask the Owner → AI agents (part of the Envorn Agent Suite). Keys start with eak_, are shown once, and can be revoked at any time. One key per agent means one agent can be switched off without touching the others.

MCP (Streamable HTTP)

Server URL: https://envorndigital.com/mcp/agent-rules, with the header Authorization: Bearer eak_…. For MCP clients that can't send headers, put the key in the path instead: https://envorndigital.com/mcp/agent-rules/eak_… (treat that URL as a secret).

Claude Code:

claude mcp add --transport http envorn-agent-rules https://envorndigital.com/mcp/agent-rules --header "Authorization: Bearer eak_YOUR_KEY"

Clients configured with JSON (field names vary slightly between clients; check yours):

{
  "mcpServers": {
    "envorn-agent-rules": {
      "type": "http",
      "url": "https://envorndigital.com/mcp/agent-rules",
      "headers": { "Authorization": "Bearer eak_YOUR_KEY" }
    }
  }
}

When the server initializes, it tells the agent to call check_permission before any action involving money, refunds, discounts, customer commitments or anything unusual, and to follow the decision.

Tools

ToolArgumentsReturns
check_permissionaction (string, required): what the agent wants to do, in plain words
amount (number): money involved, in U.S. dollars
context (string): short background
request_id, decision (allow · deny · needs_approval), reason, rules used, status_url
get_decisionrequest_id (string, required)request_id, decision (allow · deny · needs_approval), decided_by (rules, owner or waiting for owner), reason, decided_at

n8n

Install the community node n8n-nodes-envorn-agent-rules (in n8n: Settings → Community Nodes → Install), add an Envorn Agent Rules API credential with the agent key, and drop the Envorn Agent Rules node in front of any step that spends, refunds or promises. It routes each item to one of three outputs, Allow, Needs approval or Deny, so the workflow only continues when the owner's rules say yes. Use Get Decision after a Wait node to pick up the owner's answer. Errors never go to Allow.

Plain HTTP API

For automations and code that don't use MCP:

curl -X POST https://envorndigital.com/api/agent/check \
  -H "Authorization: Bearer eak_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"action": "Order 40 bike tubes from our usual supplier", "amount": 300, "context": "Stock is below 10"}'

Example response:

{
  "request_id": "pvzk4vw4834y",
  "decision": "allow",
  "reason": "You can order the bike tubes. According to our stock ordering rules, you don't need approval for orders under $500. Please place the order and record it in our system.",
  "rules": ["Stock Orders: Staff must get approval from the owner before ordering stock over $500."],
  "status_url": "https://envorndigital.com/api/agent/check/pvzk4vw4834y"
}

Check a pending request with GET on its status_url, using the same key.

What we tested

We test Agent Rules end to end with a sample business. In one test, a $300 stock order under a $500 rule was allowed, a $900 order went to the owner for approval, and a $30 refund requested over MCP was allowed under a $50 refund rule. We also found and fixed a case where a staff refund over the limit was answered "no" instead of being sent to the owner. Read what broke and how we fixed it and our one-page AI spending policy.

Good to know

Set up Ask the Owner See the Agent Suite