For most of the past two years, AI governance has been written in prose. Organisations drafted policy documents — "don't share confidential data," "always cite sources," "never draft anything legally binding" — and hoped the model would honour them. That works until it doesn't. Plain-language rules are ambiguous, hard to audit, and impossible to test before something goes wrong. Today we're shipping a better answer: Policy as Code.

From Paragraphs to Policies

Policy as Code lets ApiSpi administrators define governance rules as versioned YAML documents instead of free-form text. Each policy is a named, reviewable artifact — exactly the way infrastructure teams have managed configuration for a decade. A rule that blocks personally identifiable information from ever appearing in a reply now looks like this:

Enforced on Every Message

A policy that isn't enforced is just documentation. ApiSpi evaluates every enabled policy against each message in both directions — the user's prompt on the way in and the agent's reply on the way out. Match a sensitive keyword or a regular expression and the platform can deny the message outright, mask the offending fragment, or surface a warning, all before anything reaches a model or leaves it.

This sits alongside the controls we already described in our guide to security and compliance for AI agents. Where those covered the platform's firewall and approval layers, Policy as Code gives compliance and security teams a precise, testable surface they own directly.

Why Code Beats Prose

The shift from documents to code isn't cosmetic. It changes what governance can do:

  1. It's testable — you can validate a rule against sample inputs before it ever touches production traffic, the same way you'd test any other code.
  2. It's auditable — a regulator or internal reviewer can read the exact rules in force, not interpret a paragraph of intent.
  3. It's composable — data-residency, PII, and tool-access policies stack cleanly, with personal rules layering on top of the organisation baseline and only ever tightening it.

Built for Australian Compliance

For organisations navigating the Privacy Act reforms we covered in AI Agents and Australian Privacy Law, Policy as Code turns abstract obligations into concrete, enforced controls. A data-residency policy can pin inference to approved providers and block connectors hosted in restricted jurisdictions. A redaction policy can strip identifiers before they leave your tenancy. The rules are explicit, and so is the evidence that they ran.

Available Now

Policy as Code is live in the admin governance console for every ApiSpi organisation. It complements — rather than replaces — the existing guardrails, so teams can adopt it at their own pace, starting with a single high-value rule and expanding from there. As with everything on the platform, the goal is the same: let capability and control advance together.