Join our Newsletter — 33% off our NHI Course
Home› Glossary› AI Security› Before-and-after delta
AI Security

Before-and-after delta

← Back to Glossary
By NHI Mgmt Group Updated November 1, 2026 Domain: AI Security

A before-and-after delta records the state of a model interaction before inference and immediately after it completes. In practice, it captures inputs, policy context, outputs, and decision outcomes so reviewers can verify the full path from request to result and detect tampering or missing context.

What a before-and-after delta captures

A before-and-after delta is a point-in-time record of a model interaction at two boundaries: just before inference begins and immediately after it ends. That framing lets reviewers compare the original request, policy context, and final outcome without relying on memory or reconstructed logs, which is essential when a result needs to be audited or explained later.

Why the before state matters

The pre-inference snapshot is what makes the delta meaningful. It preserves the prompt, attached instructions, retrieval context, policy settings, and any other inputs that shaped the run, so reviewers can tell whether the model received the right context before deciding. Without that baseline, it becomes much harder to distinguish a model failure from missing, altered, or incomplete inputs.

In practice, the before state is also the best place to spot hidden prompt manipulation, stale context, or an omitted policy control, because those issues often change the result without leaving an obvious trace in the final output alone.

Why the after state matters

The post-inference snapshot records what the model actually produced and what decision path or outcome followed. That can include the response text, refusal behaviour, tool or workflow outcomes, and any decision metadata needed to interpret what happened. The after state turns an opaque generation into a reviewable event, especially when organisations need to reconstruct exactly what the system did and why.

For safety and governance work, the after state is where reviewers confirm whether the model respected policy, changed state appropriately, or emitted something that should have been blocked, transformed, or escalated.

How deltas support review and integrity

Used well, a before-and-after delta is less about simple logging and more about evidence preservation. It allows teams to compare intended context with actual outcome, then detect tampering, missing guardrails, unexpected branching, or post-processing that altered the result. That makes it useful for quality review, incident investigation, and accountability when a model interaction has security, compliance, or customer impact.

Because the delta captures both sides of the exchange, it is especially valuable when reviewers need to answer a narrow question: did the model fail because the input was wrong, the policy was missing, or the system produced an unsafe outcome despite correct inputs?

Risk and Threat Considerations

Before-and-after deltas create a security record, but they also become a target if they are incomplete, altered, or stored without integrity protection. If the before state can be edited, or if the after state can be selectively omitted, an attacker or insider can hide prompt injection, policy bypass, unauthorised output, or later tampering.

Failure mechanism: The review trail breaks when the snapshot boundary is weak, the captured context is partial, or the record can be rewritten after the fact, leaving no trustworthy comparison between input and outcome.

Impact: Organisations lose the ability to prove what the model saw, what it returned, and whether a compromise occurred, which undermines incident response, auditability, and confidence in model governance.

Standards & Framework Alignment

This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.

NIST SP 800-53 Rev 5 and NIST CSF 2.0 set the technical controls, while ISO/IEC 27001:2022 defines the regulatory obligations.

FrameworkControl / ReferenceRelevance
NIST SP 800-53 Rev 5AU-2 — Audit EventsBefore-and-after deltas capture auditable model-interaction events and context.
AU-9 — Protection of Audit InformationDelta records must resist tampering to remain trustworthy evidence.
SC-28 — Protection of Information at RestStored deltas often contain sensitive prompts, policy context, and outputs.
Recommendation — Log the pre-inference context and post-inference outcome as auditable events. Protect delta records from alteration, deletion, and unauthorised disclosure. Encrypt stored delta records to protect sensitive interaction data at rest.
NIST CSF 2.0DE.CM-03 — Detect Unauthorized Personnel, Connections, Devices, Software, and FilesDeltas help detect unexpected context changes or tampering in model runs.
Recommendation — Monitor model pipelines for unexpected changes to captured inputs and outputs.
ISO/IEC 27001:2022A.8.15 — LoggingLogging controls support traceable records of model inputs, outputs, and outcomes.
Recommendation — Define logging requirements that preserve before and after interaction evidence.

Practitioner Guidance

What to watch for: Treat the delta as a controlled evidence object, not just an application log. The most useful implementations preserve the before and after states with enough context to reconstruct the run, while also protecting the record from later alteration.

Governance implication: Ownership should be explicit across the model, orchestration, and logging layers so that the organisation knows who is responsible for capture, retention, review, and integrity checks. A delta that cannot be trusted is operationally convenient but forensically weak.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

NHIMG Editorial Note
Reviewed and updated by the NHIMG editorial team on November 1, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org