How Nomos checks application behavior, explains failures, and connects the results to build and runtime controls.

The order application has passed its structural tests. Then an AI adds diagnostic logging that includes the customer’s phone number. The contract prohibits that disclosure, but the document still passes validation.

Nomos is a semantic enforcer that checks this kind of problem. It uses the rules in a selected contract to assess what an application does with data. It examines code and execution evidence, then reports which requirements were met, which were violated, and which could not be checked.

The CI/CD pipeline uses those findings to decide whether a software build can proceed. Supported runtime integrations apply the rules when the application runs. Reviewing code and preventing an operation are different jobs; Nomos connects the requirements to both and reduces the human review cycles.

The broader ecosystem is introduced in AI Can Write the App. Now It Needs to Build Against the Data. Here, we focus on the behavior of the same simplified order application: capture an item and quantity, use a phone number for delivery updates, and generate a printable confirmation.

The examples describe the intended design. Vocabulary syntax, Nomos findings, and integration behavior are illustrative rather than finalized interfaces or claims of released functionality.

Start with a valid order and a bad logging change

Here is the order the application processes:

JSON

{
  "item": "SKU-1234",
  "quantity": 2,
  "phoneNumber": "+1-202-555-0100"
}

Under our example schema, the document is valid. The item is a nonempty string, the quantity is a positive integer, and the phone number is present. The contract also says that the phone number must stay out of diagnostic logs and the printable confirmation.

Now the AI adds this statement:

PYTHON

logger.info("Order created: %s", order)

The application still stores the order and generates the confirmation. But the logging statement writes the entire order, including its phone number.

A schema validator that receives only the order cannot see that logging operation. Checking the rule requires looking at the code, observing what it produces, or both.

The document is valid. What the application does with it is not.

Give Nomos a rule it can check

“Handle personal data carefully” does not tell a checker which behavior to allow. The contract needs a specific rule.

In our example, the restrictions sit beside the phone-number definition:

JSON

{
  "type": "object",
  "properties": {
    "phoneNumber": {
      "type": "string",
      "minLength": 1,
      "policies": ["phone-no-log", "phone-no-response"]
    }
  },
  "dsv": {
    "policies": {
      "phone-no-log": {
        "rules": [
          {
            "operation": "log",
            "constraint": "deny",
            "enforcement": "block"
          }
        ]
      },
      "phone-no-response": {
        "rules": [
          {
            "operation": "respond",
            "constraint": "deny",
            "enforcement": "block"
          }
        ]
      }
    }
  }
}

This excerpt is located under properties in the JSON schema we specified. The identifiers phone-no-log and phone-no-response let Nomos name the exact rule it checked.

The phone number is still needed for delivery updates. Removing it from the whole application would not be a correct fix. The restrictions apply to logs and confirmations, not to every use of the value.

Excluding the phone number is also different from masking it. If the contract says not to include it in a confirmation, an enforcer should not decide that showing the last few digits is acceptable. The vocabulary and versioning model are explained in From JSON Schema to a Versioned Software Dependency.

Resolve the rule, inspect the code, return a finding

For a particular check, Nomos needs three versioned inputs:

The contract. Resolve the exact version and its referenced definitions. Identify the rules that apply to this application’s use of the data and its outputs.

The application. Identify the source revision, configuration, tests, and executable artifacts to check. A description of what the application is supposed to do is not enough.

The enforcer. Select the Nomos enforcer or reviewer version, the checks it performs, and the evidence those checks need.

Nomos returns findings tied to those inputs. Each finding identifies the rule, what was checked, where a problem was found, and any part that could not be evaluated.

An AI reviewer can help assess the code. Executable tests can show what the application actually produces. A runtime control can act when an operation occurs. A review finding alone does not stop a later log message or export.

Check the code and exercise the application

For the order application, each rule points to a path or output to examine:

RequirementWhat to checkEvidence to examine
Keep the phone number out of logsOrder creation, errors, retries, and logging pathsSource findings and captured log output
Leave it out of the confirmationConfirmation creation and document generationSource findings and the generated confirmation
Keep delivery updates workingThe delivery-update workflowThe contact value reaches the permitted operation

The delivery check matters too. The application must still send delivery updates. Preventing all use of the phone number would avoid disclosure by breaking the requested feature.

Look beyond the field name

Source review can spot the direct problem in logger.info(“Order created: %s”, order). It also needs to follow the value through the surrounding code.

The application might rename phoneNumber to contact, copy it into another object, or pass it through a helper. Searching for one field name would miss those cases.

AI-assisted review can help trace those paths. If the result depends on configuration or execution, the reviewer should ask for that evidence rather than claim certainty. A comment saying “this output is safe” does not establish that the rule is satisfied.

Run the relevant paths

A test can create an order with synthetic data, run the application, capture its diagnostic output, and generate the printable confirmation. It can then check whether the protected value appears where the contract prohibits it.

If the synthetic phone number appears in the captured log, the test has demonstrated a violation. If it does not, the test establishes only that the inspected path and output satisfied the check.

The checks need to account for relevant error paths, outputs, and ways the value may be represented. Finding no exact string match in one log is not proof that the application never discloses the number.

Fix the code and rerun the checks

For this logging statement, the application can select only the fields permitted in the message:

PYTHON

logger.info(
    "Order created: item=%s quantity=%s",
    order["item"],
    order["quantity"],
)

The printable confirmation can likewise select the fields it is allowed to include, instead of copying the full order:

PYTHON

confirmation = {
    "item": order["item"],
    "quantity": order["quantity"],
}

These changes fix the paths shown here. The tests still need to run again, and other logging or export paths still need their own checks.

Find the rule. Locate the failure. Change the code. Rerun the check.

Show the developer or agent what failed

“Policy check failed” leaves the developer guessing. A useful finding says which rule failed, where it happened, and what evidence supports the result.

For the logging example, an illustrative finding looks like this:

JSON

{
  "contract": {
    "id": "https://contracts.example.com/order?version=1.0.0",
  },
  "sourceCommit": "<commit-hash>",
  "enforcer": {
    "id": "order-data-use-review",
    "version": "1.0.0"
  },
  "ruleId": "phone-no-log",
  "result": "FAIL",
  "check": "checkout-log-capture",
  "location": "app/order_service.py:create_order",
  "message": "Protected phoneNumber appeared in diagnostic output.",
  "evidence": {
    "reference": "<controlled-evidence-reference>",
    "sensitiveValues": "omitted"
  },
  "remediation": "Log permitted fields instead of the complete order."
}

The developer or coding agent can see that phone-no-log failed in create_order, and that the captured output supports the finding. The suggested correction is specific and actionable: log permitted fields rather than the entire order.

The full evidence record should identify the exact contract content, application revision, checking tools, test execution, and environment. When an AI reviewer contributes, it should also identify the model, prompt bundle, enforcer version, and change reviewed. Those details belong to the evidence, not to the contract itself.

The report must not repeat the disclosure. It should name the field and location without copying a protected phone number into a pull-request comment. Any sensitive evidence that must be retained needs appropriate access controls.

Explain the failure without creating another one.

Run Nomos in the pull request

The developer or agent should not have to remember a separate review process. Therefore, Nomos is intended to fit into the team’s existing CI/CD pipeline including, for example, GitHub Actions or even in stand-alone environments.

When a change is submitted, the CI/CD pipeline resolves the application’s pinned contracts and runs the Nomos checks. Structural validators check the documents; Nomos checks the behavior; ordinary application tests check the rest of the requested functionality.

Our new logging statement must be checked against phone-no-log even though the contract has not changed. Existing rules remain relevant when an AI adds or modifies code.

The pipeline also needs to distinguish a violation from a check that could not be completed:

ResultWhat it means
PassThe enforcer completed and its criteria were met within the reported scope.
FailThe enforcer found a rule violation.
Unsupported or inconclusiveThe enforcer could not determine whether the rule was satisfied.
Execution errorSomething failed while running the check.

A mandatory failure blocks the promotion in the CI/CD pipeline. Missing evidence must be resolved or sent through the configured exception process; it is not a pass. Nomos supplies the findings, and the CI/CD pipeline applies the deployment decision.

An example of a Nomos output in Git Actions

An authorized exception should record why the candidate may proceed while preserving the failed finding. The person or agent writing the application does not automatically have authority to approve that exception. This should be solved in separation of duties processes.

Version the enforcer as well as the contract

Order 1.0.0 may stay unchanged while its enforcer improves. A new reviewer might inspect an exception path that the earlier version missed. A test suite might add a retry behavior, or a model and prompt might change.

Those changes need versions too. In the intended design, Nomos configurations and enforcers are versioned code artifacts. A proposed enforcer is evaluated against a defined test suite before it is approved for use.

For our order application, that suite should include known violations and permitted behavior: logging the full order, logging the phone number under a different field name, leaving it out of a confirmation, and using it for delivery updates.

The suite checks both sides: does the reviewer find the violations, and does it allow legitimate use?

Each result should record the contract and source versions, the enforcer and tests used, and the relevant model or tool settings. That makes a historical result explainable and allows comparisons when an enforcer changes. It does not guarantee that an AI review will produce the same answer every time.

A compatible schema does not prove correct behavior

The repository checks whether a proposed contract version meets its compatibility policy. The fast validation technology is intended to support that analysis as well as checking individual documents.

Nomos asks a different question: does this application follow the rules in the selected contract?

Suppose Order 2.0.0 requires the customer’s phone number to be masked on a support screen. The JSON structure can stay the same while the application needs new display logic. Structural compatibility does not prove that the masking is implemented. The relevant Nomos checks still need to inspect that code or exercise that screen.

The reverse matters too. Our prohibited logging change is an application bug under Order 1.0.0, not a reason to weaken the contract. A coding agent should fix the implementation or submit a legitimate contract change through the appropriate process, not silently switch definitions to make a check pass.

Compatibility checks the change to the contract. Nomos checks the application against it.

Keep the rules active in production

A passing build records what was checked on the tested candidate. It does not remove the need for runtime controls.

For the order application, a logging adapter could restrict which fields are emitted. The confirmation generator could use an output model that excludes the phone number. Supported integrations apply the rules where those operations happen.

The contract should say where a rule applies, what triggers it, what action to take, what to do on failure, and how the control is rolled out. The runtime integration implements those requirements within the operations it supports.

Blocking a phone number before it enters a log is different from reporting the disclosure afterward. Monitoring may reveal a violation, but it does not undo it, leaving data exposed.

Coverage must be explicit. A logging control cannot protect a path that bypasses it. A database validator cannot inspect what an external application later puts into a PDF. The integration needs to identify covered operations, active controls, and remaining gaps.

Runtime enforcement does not require an AI review for every request or a repository call for every log message. Resolved rules can drive ordinary code and cached settings. Those controls must stay tied to the contract version and deployment they serve.

Structural validation and its execution model are covered in From Definition to Execution: Fast JSON Schema Validation.

Make the checks inspectable and reusable

We aim to develop Nomos components, interfaces, and examples openly, alongside the vocabulary and repository. Different applications use different logging systems, document generators, frameworks, and runtimes; their integrations need a shared meaning for the rules.

An integration should state what it checks, what evidence it returns, and what it cannot evaluate. Shared tests should include both violations and permitted behavior. Developers should be able to inspect how a finding was produced and contribute support for additional environments.

The requirement stays the same even when platforms enforce it differently. Database integration is one setting, explored in The Database AI Builds From—Not Just the Place It Stores Data.

Related reading: Overview – link | Vocabulary and repository – link | Validators – link | Database integration – link.

From a declared rule to checked behavior

Our order began as valid data. A small logging change then broke a rule about how that data could be used. Nomos connected the rule to the code and its output, returned a finding, and gave the coding agent a specific problem to fix.

That is not a blanket guarantee that the application is safe. It is a clear record of the requirement, the check, the evidence, and the decision or control that follows.

As AI changes more code, those requirements need to outlast the prompt that created the application. The same contract can guide the next review, the next test run, and the controls that remain active in production.

Project Delphi defines what the application must respect. Nomos makes those obligations enforceable—and connects them to the build and runtime controls that put them into practice.