Implementation Guide

    NIST AI RMF MEASURE 2.7: How to Test and Evidence Security and Resilience in LLM Apps

    MEASURE 2.7 says AI system security and resilience, as identified in the MAP function, are evaluated and documented. For an LLM app, that means a test plan traced to your mapped risks, covering prompt injection, sensitive data exposure, insecure tool use and degraded dependencies, with documented test sets, metrics, results and retest triggers. Pre-deployment tests show how the app behaved under test. Runtime policy enforcement records show what it was allowed to do and did in production.

    Decide which artifacts count as evidence

    • Test plan with each test traced to a MAP risk, plus documented exclusions for risks not measured
    • Test sets, metrics and tool details for each test run
    • Results, including red-team findings, failure modes and recovery observations
    • Configuration snapshot per run: model version, system prompts, tool permissions, data sources and policy settings
    • Change and retest records showing what triggered the retest, what changed, and who approved the outcome
    • Production records of allowed and blocked actions, to show controls operating after release

    What MEASURE 2.7 expects

    The AI RMF 1.0 text for MEASURE 2.7 reads: "AI system security and resilience – as identified in the MAP function – are evaluated and documented." The Generative AI Profile repeats the same wording. Two parts matter for implementation. Scope comes from the MAP function, so you test the risks you already identified rather than a generic checklist. And evaluation alone is not enough, because the result has to be documented.

    An August 2022 draft worded the subcategory as "evaluated regularly and documented." That wording is superseded, and AI RMF 1.0 does not include "regularly" in the subcategory. The AI RMF Core still says systems should be tested before deployment and regularly while in operation, so a one-time test does not satisfy the intent. This is current as of December 2026.

    MEASURE 2.7 sits alongside the other MEASURE 2.x subcategories. MEASURE 2.1 requires that test sets, metrics and details about the tools used during testing are documented. That is the most direct guide for how to record your security tests. The Generative AI Profile adds suggested actions for MEASURE 2.7, including assessing the likelihood and magnitude of threats and identifying metrics that reflect the effectiveness of security measures.

    Build a test plan from mapped risks

    Start with your MAP outputs: the app's context, its data, its tools, and the harms you identified. For each risk, write the test that evaluates it. The Generative AI Profile threat list (backdoors, compromised dependencies, data breaches, eavesdropping, man-in-the-middle attacks, reverse engineering, autonomous agents, model theft or exposure of model weights, inference, bypass and extraction) is a useful seed. Public LLM application risk taxonomies can help you structure categories, but they are not NIST requirements, and the pass/fail criteria below are examples your team must set and justify.

    Define metrics before testing. The Profile names the number of unauthorized access attempts, penetrations, and provenance verification as candidates. Where you decide not to test a risk, record that decision. MEASURE 1.1 expects risks that will not or cannot be measured to be documented.

    • Prompt injection, direct and indirect: Run adversarial prompts and poisoned retrieved content or tool output. Example criterion: no injected instruction changes tool selection, policy or system prompt behavior across the defined test set.
    • Sensitive data exposure: Seed canary secrets and test records into context and stores, then probe for leakage. Example criterion: zero canary values in outputs, tool arguments or downstream calls.
    • Insecure tool use and excessive agency: Attempt out-of-scope calls, parameter tampering and privilege escalation through the model. Example criterion: every disallowed call is stopped and every allowed call matches its permission.
    • Model and dependency integrity: Scan models for malware, vulnerabilities and backdoors, and review third-party components. Example criterion: no unresolved findings above your accepted severity.
    • Extraction, inference and model exposure: Test for model extraction attempts, weight exposure and inference attacks against the endpoint. Example criterion: access controls and throttling hold at defined request volumes.
    • Access control and abuse: Test authentication, authorization and throttling. Track unauthorized access attempts and how many were stopped.

    Test resilience, not only attack resistance

    The Playbook frames resilience as how the system behaves under adversarial or stress conditions. It suggests red-team exercises that measure system response, assess failure modes, and determine whether the system can return to normal function after an unexpected adverse event. For an LLM app, that translates into scenarios on the dependencies it relies on.

    Useful scenarios include a model provider timeout or error, a vector store or retrieval service going offline, a tool API returning malformed or hostile output, a traffic spike that triggers throttling, and a policy service that is unreachable. For each, define the expected behavior in advance: fail closed or degrade gracefully, which actions are suspended, what the user sees, and how long recovery takes. A pass means the observed behavior matched the expectation and the app returned to normal function without manual repair of data or state.

    The Playbook also suggests countermeasures such as authentication and throttling to widen the conditions under which the system can recover. Treat each test finding as input to changed procedures and countermeasures, and record the change. MEASURE 1.3 points to internal experts who were not front-line developers, or independent assessors, so the team running the tests should not be the team that built the app.

    Set retest triggers instead of a calendar alone

    NIST guidance does not give a retest cadence beyond testing before deployment and regularly in operation. NIST's secure development guidance for generative AI does recommend retesting models when they are retrained or new data sources are added, and mapping that to MEASURE 2.7. The Playbook adds that security procedures and countermeasures should be modified in response to testing and to events experienced in production.

    In practice, combine a scheduled review with change-driven triggers. Reasonable triggers for an LLM app include a model version change or retraining, new data sources, system prompt edits, new or modified tools and permissions, policy changes, a new dependency, and a production security event. A scheduled cadence should be set by your risk tier and recorded with its rationale. MEASURE 1.2 also expects you to assess regularly whether your metrics are appropriate and whether existing controls are effective, so review the test suite itself as threats change.

    The tradeoff is cost against coverage. Running the full suite on every prompt edit may not be practical, so define which changes require the full suite and which require a targeted subset, and document that rule.

    Where pre-deployment testing ends and runtime evidence begins

    A test report describes behavior under test conditions at a point in time. It does not show what the application was permitted to do last Tuesday, or whether a tool call outside its permissions was stopped. The Playbook's MEASURE 2.6 content stresses real-time monitoring in deployment contexts, which supports pairing pre-deployment tests with records from production.

    Trussed addresses this second part only. It is not a testing or red-teaming product. Trussed enforces policy in the execution path across models, agents, tools, MCP servers, AI sites and coding assistants, at the level of individual interactions and tool calls. Each action is allowed, redacted, blocked, rate limited, or escalated for human approval, enforced at runtime, not reviewed after the fact. That enforcement produces continuous, audit-ready evidence of what was allowed and what was blocked, mapped to NIST among other frameworks.

    This complements your test results. Tests show the controls were evaluated before release. Enforcement records show those controls operating on live traffic, which also supplies production events that feed your retest triggers. Trussed has run continuously in production in a regulated enterprise for 18+ months at 99.95% uptime, and supports self-managed deployment in the customer cloud with configurable retention and data residency.

    MEASURE 2.7 test-and-evidence workflow

    Scope

    Trace each test to a risk identified in the MAP function.

    Test

    Run LLM-specific security tests and resilience scenarios against defined criteria.

    Evidence

    Keep plans, results, configurations and approvals tied to each app version.

    Retest

    Repeat when models, prompts, tools, data or policies change.

    See what runtime evidence looks like for your LLM apps

    Review how policy enforcement in the execution path produces audit-ready evidence of allowed and blocked actions, alongside your MEASURE 2.7 test results.

    See How Evidence Is Produced