# Enforce policy before the action runs.

> Product page for the Policy Engine: it turns your policies into rules your agents follow on every run, and warns, corrects or stops an agent before the answer or action goes out.

- **URL:** https://aisquare.studio/product/policy-gates
- **Audience:** Compliance, risk and platform teams who need agents to follow company policy at runtime, and developers who read verdicts over the API
- **Topics:** policy engine, runtime policy enforcement, policy enforcement, AI guardrails, guardrails for AI agents, rulebook, deterministic rules, LLM-backed rules, Warning, Improving and Blocking modes, Audit and Live modes, verdict API, replay, rule versioning, signed verdicts, EU AI Act

## Policy Engine

Enforce policy before the action runs.

Turn your policies into rules your agents follow on every run. When an agent is about to break one, AISquare warns, corrects or stops it before the answer or action goes out.

Example from the page. Before (agent draft): “The Global Equity Index Fund has returned an average of 10.5% a year. Past performance does not guarantee future results.” Missing source and period. After (sent to customer): “The Global Equity Index Fund has returned an average of 10.5% a year over the last 10 years (source: fund factsheet). Past performance does not guarantee future results.” Source and period added.

Policy checks · this reply (4 rules):

- Every return figure must cite a fund source: Fixed automatically (Improving · source added before sending)

- Add the past performance risk warning: Passed

- Never share a full account number: Passed

- Mask email and phone in replies: Passed

## A violation you catch after the fact already happened.

- 1. The agent acts (The Policy Engine works here)

- 2. A report gets written

- 3. Someone finds the damage

Most tools start at step two. The Policy Engine works before step one.

## From your policy to a rule your agent follows.

Fund disclosures.pdf, plus your agent's system prompt, becomes a draft rulebook · 4 rules:

- Every return figure must cite a fund source (LLM-backed; Fund disclosures, p.12)

- Add the past performance risk warning (LLM-backed; Fund disclosures, p.14)

- Never share a full account number (Deterministic; System prompt)

- Mask email and phone in replies (Deterministic; System prompt)

AISquare drafts rules from your system prompts, policy documents, PRDs, repos, Google Drive, OneDrive and OPA. Each rule cites its source, and your team decides what goes live.

Deterministic rules hold hard limits like formats and ranges. LLM-backed rules handle judgment calls like advice versus guidance.

## Warn, correct or stop. You choose per rule.

- Warning. The agent: Carries on. Your customer: Gets the reply as written. Your team: Sees the run flagged for review. Use it for: New rules you're still tuning.

- Improving. The agent: Gets the missing requirement and retries. Your customer: Gets the corrected reply. Your team: Sees the before and after. Use it for: Disclosures, citations and required steps.

- Blocking. The agent: Is stopped and told why. Your customer: Gets nothing that breaks the rule. Your team: Gets an alert through webhooks and alerts. Use it for: Lines that must never be crossed.

From lighter to stricter: Audit (Records only), Warning, Improving, Blocking.

- Audit: Refund above the cap. Went through. Recorded for review.

- Live: Refund above the cap. Held. Your team was alerted.

One switch, no code change.

## Every verdict, on the record.

Each run gets a verdict for every rule it touched.

- Rule: The exact text that was live, with its source.

- Verdict: Passed, flagged, corrected or blocked.

- Reasoning: Why the check passed or failed, in plain language.

- Version: Which version of the rule was applied.

- Signature: Signed, so the record can't be changed later.

Verdicts roll up into signed attestations you can map to frameworks like the EU AI Act.

## Change a rule. See what it would have caught.

Edit a rule and re-grade past runs against it, without running the agent again. Version history shows who changed what.

- v3 (replaced): Cite the source for performance figures.

- v4: Every return figure must cite a fund source and its period.

- Run 398 · would fail

- Run 401 · would fail

- Run 405 · passes

When the same rule keeps failing, Learnings proposes the fix.

## Watching is not controlling.

Compared with observability, input filters and cloud security, only the Policy Engine does all four:

- Checks before the action goes out (input filters: Input only)

- Uses your own policies

- Corrects the agent, not only blocks

- Records every decision with evidence (observability: Traces only)

## Read every verdict over the API.

Verdict API: GET /v1/studios/{studio_id}/runs/{run_id}/policies

The page's Copy button copies: curl -s -H "X-API-KEY: $EXPLAINABILITY_API_KEY" "$EXPLAINABILITY_GATEWAY_URL/v1/studios/$STUDIO_ID/runs/$RUN_ID/policies"

## Questions, answered.

- Does enforcement happen before or after the action? Before. Rules are checked before the answer or action goes out; Audit mode only records.

- Where do rules come from? Your documents, system prompts, PRDs, repos, Drive, OneDrive, OPA, or written by hand. Each draft rule cites its source and your team approves it.

- What kinds of rules are there? Deterministic for hard limits like formats and ranges, LLM-backed for judgment calls like advice versus guidance.

- What do Warning, Improving and Blocking do? Warning flags the run, Improving corrects the agent and lets it retry, Blocking holds the action and tells the agent why.

- How does my team hear about escalations? Through webhooks and alerts.

- Can I try it without changing behavior? Yes. Start in Audit, then switch to Live with no code change.

- Does it work with the agents we already run? Yes, through the proxy or the SDK.

- How does this help with audits? Every verdict is recorded with the rule version and signed, and rolls up into attestations you can map to frameworks like the EU AI Act.

## Part of the picture.

- RML and Explainability: See the claims and evidence behind each run.

- Learnings: Turn corrections into better runs.

- Audit and Attestations: Put signed evidence on the record.

## From the blog

- [AI Governance Tools: A Buyer’s Guide for Teams With Agents](https://aisquare.studio/blogs/ai-governance-tools)

## Stop bad actions before they happen.

Put your rules in the decision path and enforce them on every run.

## Links

- [Book a demo](https://calendly.com/d/dws4-msf-8jc/aisquare-gtm-team)
- [Read the docs](https://docs.aisquare.studio/docs/govern/prevent/)
- [Connect your agent](https://aisquare.studio/product/connectors)
- [See RML and Explainability](https://aisquare.studio/product/reasoning-graph)
- [See Learnings](https://aisquare.studio/product/learning-layer)
- [See Audit and Attestations](https://aisquare.studio/product/audit)
- [AI Governance Tools: A Buyer’s Guide for Teams With Agents](https://aisquare.studio/blogs/ai-governance-tools)

---

**Machine-readable AISquare**

- Site index for LLMs: https://aisquare.studio/llms.txt
- Agent instructions (when to use AISquare): https://aisquare.studio/agents.md
- OpenAPI specification: https://aisquare.studio/openapi.json
- MCP endpoint (Streamable HTTP, POST): https://aisquare.studio/mcp
- Sitemap: https://aisquare.studio/sitemap.xml
- Blog feed (RSS, full posts): https://aisquare.studio/blogs/rss.xml
- Any page on this site also serves markdown: append `.md` to its path (the homepage is `/index.md`) or send `Accept: text/markdown`.
