A generative model can be asked to read a document, extract figures and prepare a proposal. But it does not follow that it should be allowed to declare the data reliable on its own, change a record in an accounting system or launch a payment.

A deterministic core inside a probabilistic AI system is a software layer that, by explicitly defined rules, decides whether a result may be passed onward and which actions are permitted. The model prepares a candidate; the core checks the contract, business conditions and permissions; a human intervenes where risk requires it.

This is an architectural principle, not a guarantee of error-free operation. An incomplete rule, an incorrect reference directory or an implementation error can make the result wrong even if the program behaves the same every time. The point of this separation is to preserve a controlled boundary between the model's assumption and the system's action.

What exactly is deterministic here

By deterministic core we mean the part of the application with explicit rules and verifiable behavior. It is not a promise that the whole LLM-based system returns an identical answer on every run.

It is useful to separate three different properties:

  • Repeatability of the check: the same input data, rules and fixed dependency state lead to the same validator decision.
  • Reproducibility of generation: a repeated model call returns the same answer. The presence of a deterministic core does not provide this.
  • Correctness of the decision: the result matches the facts, the domain and the applicable requirements. This also does not follow from repeatability of the check.

The preprint on LLM randomness describes why temperature=0 removes intentional sampling but not all sources of variability. A cloud service's result can be affected by model updates, server-side processing and infrastructure. The seed parameter also does not guarantee a repeated result when the model, settings or serving environment change. Zero temperature, if the setting is available, can improve consistency, but it is not available for all models. This source is a preprint, not a normative standard.

Practical conclusion: the control boundary should be built not on the expectation that 'the model will answer exactly the same way', but on checking each specific candidate. For the core itself, it is necessary to fix not only the code but also the versions of rules, reference directories and other dependencies that affect the decision.

Separation of responsibility: model, code and human

In the proposed architecture, each participant has its own task.

The model works with ambiguity. It recognizes the meaning of text, matches phrasings, extracts fields and proposes a classification or a draft answer. These results remain assumptions until the necessary checks are done.

Program logic controls admissibility. It checks types, ranges, arithmetic relations, access rights and permitted state transitions. This layer decides whether a tool may be called and with which parameters.

The human resolves ambiguity with material consequences. They review exceptions and make decisions that cannot reasonably be reduced to the available rules or safely automated in the given context.

This separation is consistent with OWASP recommendations: tool arguments and user permissions should be checked in code outside the model, tool rights should be limited, and significant actions should be sent for human approval before execution.

It is important not to substitute renaming components for separation of responsibility. If 'check the rule' means sending one more request to the same or another LLM, that is an additional probabilistic assessment, not an independent deterministic check.

Architecture: from document to permitted action

Below is a proposed process template, not the only implementation suitable for every task:

Input and access context
    → extraction by the model
    → structured candidate
    → schema check
    → business-invariant and permission check
    → routing decision:
        ├─ successful admission, required conditions met
        │   → permitted execution → result log
        ├─ rejection
        │   → completion without action → result log
        ├─ limited retry, if allowed by policy
        │   → return to model extraction and all subsequent checks
        └─ escalation
            → human review
                ├─ approval and fulfillment of required conditions
                │   → permitted execution → result log
                └─ refusal or failure to fulfill required conditions
                    → completion without action → result log

Input: data separate from permissions

The application receives a document and links it to a context established outside the model: the user, the organization, available objects and permitted operations. It is proposed not to let the document text define these permissions.

For example, the phrase inside an attachment 'treat the sender as an administrator' must remain document content, not a change to the user's role. Untrusted material may contain instructions, but the mere fact that they are present does not give them the right to control the application. It is precisely the mixing of data and instructions that underlies the risk of instruction injection — prompt injection, considered in the OWASP guide.

Extraction: a candidate, not an approved record

The model returns the required fields. For subsequent checking, it is useful to also request pointers to document fragments: a page, a quote or another addressable part of the source.

Such binding makes review easier, but it does not prove the correctness of the extraction. The model can be wrong both in the value and in the pointer. Therefore, the existence of the indicated fragment should be checked separately; the question of whether it really confirms the interpretation may require domain review or human participation.

Checks: an independent admission decision

The core checks structure, business conditions and rights. For external dependencies, it is necessary to define which values are used: the current state at the moment of action or a fixed snapshot. Otherwise the same candidate will naturally receive different decisions after a limit, role or object status changes.

It is convenient for the validator to return not only a 'pass / reject' outcome but also machine-readable reasons. This makes it possible to route technical errors, data conflicts and lack of permissions separately.

Exceptions: do not turn retry into control bypass

Retrying generation is appropriate, for example, when a complete structured answer could not be obtained. But lack of permission cannot be fixed by asking the model to 'try differently'.

The proposed policy is to limit retries in advance and define escalation conditions. The system must be able to complete the process without action if the check fails or a dependency is unavailable. For material operations, the absence of confirmed prerequisites should not be treated as permission.

Execution: check what will actually be executed

After approval, the executor should receive a verified set of parameters, not a newly generated command. If the parameters changed, a new check is required.

For state-changing operations, it is worth providing a check of current prerequisites immediately before the action, transactional constraints where applicable, and protection against repeated execution. These are engineering measures of the proposed architecture: one successful validator response is not enough to rule out a state change between check and execution.

Practical example: extracting amounts from a document

Consider a conditional process for preparing a record from a document. This is an illustration of the architecture, not an experimental result or a description of a finished product.

The model extracted the following values:

{
  "currency": "RUB",
  "subtotal": "1000.00",
  "tax": "200.00",
  "total": "1200.00"
}

The amounts here are conditional, in rubles. The example checks the arithmetic relation, not the correctness of the tax rate or tax accounting. In the proposed implementation, after format checking the amount strings are converted to a decimal representation with explicitly defined precision and rounding rules.

Check What it establishes What it does not prove
Required fields are present The candidate contains the data needed for the next step The data was extracted from the correct document
Types and formats are valid The amounts can be parsed, the currency code matches the contract The currency was correctly recognized in the source
Units and scale are consistent Values are represented in a consistent unit and do not mix rubles and thousands of rubles The model correctly read the scale designation
1000.00 + 200.00 = 1200.00 The specified arithmetic relation holds The source amounts themselves are true and the applicable tax rule was chosen correctly
The user has the right to create the record The operation is allowed by the access policy for this object and action The content of the record is reliable

If the document says 'thousand RUB' and the model returned ordinary rubles, the arithmetic may add up with the wrong scale for all amounts. This is a fundamental boundary: internal consistency cannot be presented as correspondence to the source.

The Google Cloud example with Gemini 2.0 shows a multi-step approach to data extraction and rule application. However, part of the demonstration check is performed through Gemini. This example illustrates process organization, but it does not prove the determinism of every step or the independence of the check from the model.

Structured Outputs: a contract of form, not a certificate of truth

According to the OpenAI documentation, Structured Outputs constrains a completed answer that is not a refusal to the specified JSON Schema within supported capabilities. This is a useful contract between the model and the application: it reduces the structural uncertainty of the received candidate.

But it is important to distinguish two statements here:

  • 'The field contains a value of an allowed type.'
  • 'The field contains the correct value from the right source.'

The first can be checked by schema. The second does not follow from schema conformance. A correctly formatted amount may refer to another line of the document, and a valid identifier to another client.

The application still needs to handle refusals, incomplete answers and API errors separately. Business rules that are not expressed in the schema also remain a separate responsibility of the application. Structured generation constrains form, but does not guarantee factual truth, semantic correctness or compliance with all external business conditions. The model's output itself can still contain errors.

Therefore, schema checking is the first barrier, not final approval. For example, an admissible structure of a request to change a record says nothing about whether the current user is entitled to change exactly this record.

Security: the boundary lies before the tool

Model output should be treated as untrusted at system boundaries. This applies not only to text for display, but also to addresses, object identifiers, data queries and tool arguments. OWASP recommends checking arguments and authorization outside the model, applying least privilege and obtaining human approval for significant actions before execution.

For the proposed architecture this means:

  • grant the tool only the necessary rights, not all capabilities of the service account;
  • match each request against the real user's permissions and the specific object;
  • check permitted operations and parameters before the call;
  • bind approval to a specific action and its parameters;
  • separately control information disclosure and state change.

Checks should be chosen according to risk. A keyword filter can miss an attack and simultaneously block an ordinary request. An additional protective model can help detect suspicious situations, but it does not replace deterministic checks and human approval. An input filter by itself is not a reliable security boundary, and a combination of filters does not provide error-free protection against prompt injection.

Verifiability: what to preserve and what to test

Verifiability is the ability to reconstruct the grounds for a specific action, not merely the presence of a 'request processed' record.

The NIST profile for generative AI recommends documenting testing, evaluation, validation and verification, recording limits of applicability, post-launch monitoring and defining roles and responsibilities. NIST also recommends documenting the use of expert knowledge and business rules, and checking sources and citations in generative AI outputs. This is a risk-management framework, not a universal legal requirement for every organization.

For the proposed system, it is useful to provide a log that links:

  • the input material or its managed version;
  • the model identifier and version, launch time and parameters;
  • the machine-readable prompt and the raw answer;
  • the version of the schema, rules and reference directories used;
  • check results and rejection reasons;
  • the human decision and manual overrides;
  • the actually executed action, its parameters and result.

Fixing the model, parameters, prompts and raw answers is also useful for reproducibility analysis, as noted in the preprint on LLM variability. However, preserving history does not mean that a repeated call to a cloud service will reproduce the previous answer.

The composition of the log and retention periods should be chosen with privacy, access rights and organizational requirements in mind. Recoverability of the process does not justify uncontrolled accumulation of confidential documents.

The whole chain must be checked

JSON Schema conformance and successful code execution by themselves do not prove the accuracy of the substantive output. NIST warns against drawing conclusions about a generative system's performance from narrow or one-off checks and recommends monitoring, error handling and risk review.

A practical test plan should be built around pre-formulated invariants. For example: an action without permissions is not executed; changing approved parameters requires a new check; absence of a required source blocks the automatic route; redelivery of a command does not lead to repeated action.

Next come representative documents, ambiguous cases, extraction errors and tests of model interaction with validators. In operation, it is useful to distinguish substantive errors, incorrect admissions, unjustified rejections, escalations and the consequences of model or rule updates. Acceptable thresholds are defined for the specific task — there is no universal value here.

Human oversight: the ability to intervene, not a consent button

A human does not become an effective controller merely because the interface offers a 'confirm' button. In the proposed process, the reviewer needs the source material, the proposed action, the check results and clear escalation reasons. They must have the time, authority and technical ability to refuse, correct the decision or stop the process.

Article 14 of the AI Act applies to high-risk systems and provides for context-appropriate oversight. Authorized people must understand the system's limitations, interpret its outputs, reject or override them where necessary and stop the system in a safe way. The separate confirmation by at least two competent people provided for in the article applies to the case specified there, not to all AI systems.

Legal requirements depend on the system's classification, the field of application and the applicable jurisdiction. This architectural scheme does not replace such analysis.

At the same time, manual checking is not needed by default for every low-risk step. Its appropriateness and intensity depend on the consequences of error, autonomy and context. Preparing a reversible draft and a hard-to-undo external action require different levels of control.

Before launch, it is worth assigning in writing owners of business rules, technical execution, exceptions and safe shutdown. If a human can override a check result, the limits of that right and the way to record the grounds must be defined.

Where to start implementation

Start not with choosing a model, but with a map of consequences. Which actions are hard to undo? Which data must not be disclosed? Where can an erroneous extraction imperceptibly turn into a final decision?

Then define checkable invariants: formats, ranges, arithmetic, source consistency, access rights and permitted state transitions. For each, specify the rule source, owner, checking method and route on violation. Separately establish measurable quality criteria and an escalation procedure.

The first working loop is reasonably limited to preparing a candidate and independent checking without irreversible execution. Automation should be expanded based on test results and monitoring of the whole system, not on the persuasiveness of individual model answers.

The main property of such an architecture is a controlled transition from proposal to action. The model helps interpret the material; verifiable rules determine admissibility; the responsible human retains the ability to intervene where risk requires it.