Skip to content

Articles8 min read

The Exception Is the Policy: Why Enterprise AI Rules Can't Be Simple Toggles

Enterprise AI rules need precise exceptions. Trusted context, explicit conditions and regression tests help preserve legitimate work while blocking prohibited requests.

Published

AI Governance Series 04: The Exception Is the Policy. Precise rules need precise exceptions, illustrated by allowed requests within a bounded exception.

In short

  • A source-code policy needs to distinguish public, customer-owned and unclassified code, and check where each request is going.
  • Exceptions need explicit limits on the actor, action, data, destination and evidence, including an expiry date.
  • Test permitted requests as well as blocked ones, expired exceptions and missing context.

Writing “block confidential data” takes a minute. Deciding exactly when that rule applies, and when it doesn’t, is the real work.

Imagine a European software company rolling out an AI coding assistant. Developers love it: it explains unfamiliar functions, writes tests and helps diagnose bugs. Security’s first rule is simple: no source code goes to external AI providers.

The rule lasts about a week. One developer pastes an open-source library under a permissive licence. Another shares customer code with an approved private model. A third pastes an internal module into a public model, unaware that the repository belongs to a client. A fourth uses a snippet whose ownership has never been classified.

Should all four requests be blocked? The rule about external providers blocks the external requests but says nothing about the approved private model. Extending it to every AI model would also block legitimate private use. Having no rule blocks none, and a client’s code leaves the company. Neither matches what the business intended.

Recognising source code is the easy part. Enforcing the conditions under which it may be used is the work.

Blanket restrictions solve the wrong problem

Turning a category on or off is attractive. It is easy to communicate, easy to configure and initially reassuring. But enterprises are full of legitimate exceptions. “Never send code to AI” prevents useful development work. “Allow code on approved models” fails when the approved model is external and the code is confidential. Even “block confidential code” leaves two questions open: who classified it, and where is it going?

In this example the actual rule is more precise. Public code can go to an approved external or private model. Without a listed exception, customer code can go only to an approved private model, meaning one that runs in infrastructure the company controls. Unclassified code can go to an approved private model in this example. Code with no trusted classification must never be treated as public by default.

Matrix of six cases: public, customer and unclassified code against approved external and approved private models, each marked allow or block

Figure 1. One rule, six cases. Illustrative policy design, not actual request telemetry. “No restriction” refers only to this example’s destination rule; it does not override licence terms or other obligations.

An exception is part of the rule, not a loophole

Security discussions often treat exceptions as concessions. In policy engineering, an exception is often what makes a restriction correct.

Suppose one client’s contract allows an external model to generate unit tests for its non-production code until the end of the year. That is a real exception. It leaves the rule intact for every other client, every other purpose and every later date. Without those limits, a legitimate exception turns into an accidental blanket permission.

An exception needs boundaries: who may use it, which data, which action, which destination and which evidence of authorisation. Think of it as a testable statement: code from client 1042 may go to the approved external model for test generation by authorised developers until 31 December, provided the repository classification is verified.

It must also be possible to explain why the exception applied. Otherwise the business cannot tell a correctly permitted request from an unintended bypass.

Five conditions joined by plus signs: actor, action, data, destination and evidence, which together allow one exception; any missing condition blocks

Figure 2. The boundaries of one exception.

Where classification comes from

Could an AI classifier decide whether a snippet is proprietary? It can offer clues, but appearance is a poor guide to ownership. Public and private projects often contain nearly identical patterns, a licence header can be missing, and a comment saying “public” proves nothing.

The stronger signal is trusted application context: repository ownership, a classification managed by the organisation, the authenticated identity and the selected model environment. A repository integration must explicitly attach that context to the request, and the enforcement point must verify its source.

A pasted snippet carries none of it. For free-form paste, treat code without trusted context as unclassified and block external destinations. Where the policy permits it, offer the approved private model instead. Deterministic hints, such as internal package names, hostnames or copyright headers, can also flag likely customer or internal code, but they do not establish permission to share it. Semantic inspection can help by recognising concepts that carry no standard label, but its confidence is a hint, not an authoritative attribute.

Where attributes required for a destination are missing, the policy needs an explicit outcome: block, or route the request to a review process where the organisation has one. Unknown is not another word for approved.

From a policy statement to an enforceable decision

Turning a corporate policy into an executable one starts with defining the decision inputs. For the coding assistant they are the code classification, the requested destination, the identity of the person or application, and whether that destination is approved for that classification. The action is submitting content for model processing.

Next, define the expected outcomes, starting from examples that business and security owners agree on instead of asking a model to guess what the company probably means. Public code to an approved external model: allow. Customer code to an external model: block, unless a listed exception is in force. Customer code to an approved private model: allow. Unclassified code going external: block until it is classified.

The enforcement point must sit before the content leaves for its destination. A rule evaluated after the external model has received the prompt cannot prevent that disclosure.

A dedicated policy evaluation layer complements an AI gateway here. The gateway still handles identities, model access, routing and operational controls. The policy layer evaluates the organisation’s additional content-and-context conditions. The integration must pass trusted context and honour the decision.

Test the edges

A policy can look correct because it blocks one carefully chosen prohibited request. That is a weak test. Policies fail at the edges. Does this one let public code through without friction? Does it block customer code when a developer switches model provider? How does it handle a missing classification? What happens when an exception expires, or when an approved private destination is removed from the list?

Test allowed cases, prohibited cases, exceptions and missing information, using realistic user input and application metadata rather than idealised strings.

Table of seven test scenarios with expected allow or block outcomes and what each tests

Figure 3. Edge cases to test.

Regression testing helps most: whenever the policy changes, rerun the same labelled scenarios and inspect any unexpected differences. No test set proves that a policy will never make a mistake. But without one, the organisation cannot even show which situations it meant to permit.

Readable rules make governance operational

As policy catalogues grow, correctness becomes a collaboration problem. A business owner knows what the company intends, a security team understands the control objectives and an engineer knows where enforcement happens.

They need a shared artefact: not a checkbox labelled “protect source code” but an explicit, readable rule with its exceptions. Noozle’s policy language lets teams express conditions like these together, including approved destinations, data classifications and time-limited exceptions. This example shows how such a policy looks; field names and the source of the metadata and exception lists depend on the gateway integration:

let exception_in_force = any(customer_exceptions, {
  #.customer == request.customer
  && #.purpose == request.purpose
  && #.destination == request.destination
  && date(#.expires) > now()
});

!(
  request.destination in approved_private_models
  || (request.classification == "public"
      && request.destination in approved_external_models)
  || exception_in_force
)

Read aloud: block the request unless it goes to an approved private model, sends public code to an approved external model, or matches an unexpired exception for that customer, purpose and destination. customer_exceptions contains the exceptions approved by the business. The checks use trusted request metadata and maintained lists, rather than claims supplied by the model.

The full exception described earlier also requires an authorised developer and verified non-production classification. Those conditions must be checked as well, using the identity and classification metadata available through the integration. The policy and its exception lists need revision history, including who approved each change.

Revision history matters too. A customer might ask why a request was refused last Tuesday. The answer depends on the rule and the exceptions list in force then, not the versions visible today. Detailed traces help investigators see which conditions were evaluated and where borderline results fell, while routine decision records should keep appropriate evidence without retaining every prompt indefinitely.

Where Noozle Policy Enforcer fits

At Noozle Labs, we’re building Noozle Policy Enforcer for precisely this kind of organisation-defined enforcement. It works alongside supported AI gateways and evaluates readable policies that combine structured conditions, request context and linguistic or semantic checks where appropriate.

Policies are versioned, and decisions can be linked to the responsible rule and revision. Authorised decision traces provide deeper explanations when engineers need to investigate a result. Noozle Policy Enforcer can enforce decisions on supported request, response and agent interactions; it does not replace a repository-classification system, an identity provider or the application’s final authorisation checks.

A policy engine should enforce business intent using trustworthy facts supplied by the systems that own them. It should not pretend to know every fact itself.

The real objective is precision

Enterprise AI governance should preserve the work people are authorised to do while preventing what the organisation has explicitly prohibited. That takes conditions, evidence and exceptions narrow enough to trust and clear enough to test.

An exception is not a weakness in the policy. Very often it is the part that makes the policy usable and enforceable.