Chapter 5. Operational security and incident response

Learning objectives

  • Design audit logs that can answer incident investigations, and protect the logs themselves as sensitive data.
  • Detect cost and resource exhaustion attacks and agent runaways, and limit them with budgets and cutoff mechanisms.
  • Reduce supply chain risks of models, model files, plugins, and MCP servers through adoption and change procedures.
  • Establish LLM incident response procedures along with role owners for each stage, containment measures, evidence, and recovery criteria.
  • Explain the framework of legal notification and reporting requirements to check when a personal information leak is suspected.

Introduction

On a Friday night, a company's customer support agent began sending ten times more emails than usual. The on-call engineer received an alert and opened the logs, but the logs only showed a string of "tool call succeeded." There was no record of which session it was in, what input was read, or to whom and what was sent. Because there was no switch to turn off only the sending tool, the entire service was taken down, and customer inquiries piled up until Monday morning. The cause was identified after an investigation, but in the end, it was impossible to confirm how many customers' information had leaked where. The on-call engineer had done nothing wrong. What can be done on the day of an incident is determined by the logs and switches prepared beforehand. Moreover, operational incidents can occur even without an attacker. A single temporarily enabled setting or an overnight update can escalate into a personal information incident and a cost incident.

Operational security functions only as much as what has been prepared before an incident occurs. Starting with audit logs that can answer incident investigations and the protection of those logs, this chapter covers controls to limit cost and resource exhaustion and agent runaway, supply chain management for models and plugins, and the design of anomaly signals. Finally, it outlines LLM incident response procedures, kill switches, and notification and reporting requirements when a personal information leak is suspected.

Key concepts

What audit logs must prove

When an incident occurs, the first question asked is, "When, in whose session, what input came in, and what did the model do?" The OWASP Logging Cheat Sheet recommends recording when, where, who, and what for each event, along with an interaction identifier that links related events. In an LLM application, a single request branches into retrieval, multiple model calls, tool calls, and approvals, so an investigation stalls if the trace identifier connecting them is missing.

What to record Reason
Request timestamp, trace identifier, session/user identifier Determining blast radius, linking events
Input source (chat, document, web, email, tool result) and document identifier Tracing injection paths
Tool call name, arguments (masking sensitive values and hashing trace keys), result status, execution identity Verifying actions that actually occurred
Approval request, approval result, and approving person Verifying whether confirmation steps functioned
Guardrail and classifier determinations Which layer caught what
Model ID, versions of prompts, tool definitions, and classifiers Correlation between changes and incidents
Token usage, cost, and iteration count Detecting consumption anomalies
Authorization failures, input and output validation failures Detecting attack attempts

Logs must prove "what the system permitted and what it executed" rather than "how the model reasoned." The MCP security best practices also point out that investigations are blocked if downstream system logs only record the proxy server instead of the actual requester.

Protecting logs themselves

Logs are also sensitive data. The OWASP Logging Cheat Sheet advises removing, masking, hashing, or encrypting session identifiers, access tokens, passwords, encryption keys and other core secrets, database connection strings, payment information, and sensitive personal information from logs. It also requires protecting the logs themselves: tamper detection, copying to read-only media as soon as possible, recording and monitoring log access, and restricting and regularly reviewing viewing privileges. Sanitizing data from outside trust boundaries—such as stripping newline characters—prevents log injection. Model outputs and external documents are representative examples.

Domestic standards point in the same direction. The Standards for Personal Information Safety Measures (Personal Information Protection Commission Notification) requires retaining and managing access records of individuals who accessed personal information processing systems (excluding data subjects) for at least one year; retaining them for at least two years for systems that process personal information of 50,000 or more data subjects, unique identification information, or sensitive information; and storing access records securely to prevent them from being falsified, altered, stolen, or lost. If an agent is structured to access a personal information processing system, determine together with the Data Protection Officer how those access records correspond to the access records defined in these standards.

Whether to retain entire original conversations is a separate decision. A common compromise is to retain basic logs as masked structured fields, while storing the original text strictly needed for investigations in a separate, strictly access-controlled repository for a short period.

User identification and abuse tracking

To prevent abuse, you must know who is repeating it. OpenAI recommends attaching a safety_identifier parameter to requests to uniquely identify users, but hashing usernames or emails to avoid sending identifying information. For unauthenticated users, a session identifier can be sent instead. The same document also notes that knowing your customer (KYC), such as requiring sign-up and login, reduces risk.

Anthropic recommends notifying users who repeatedly trigger the same type of refusal about policy violations, and responding with rate limiting or blocking. To do so, record guardrail determinations alongside user identifiers stored as hashes or internal pseudonyms, and manage the mapping table to real identities separately.

Forms of unbounded consumption

OWASP LLM10 (Unbounded Consumption) is the risk that arises when users can execute excessive and uncontrolled inference. There are seven sub-risks.

Sub-risk Manifestation
Variable-length input flood Flooding with inputs of varying lengths to target processing inefficiencies
Denial of Wallet Inflating pay-as-you-go costs to inflict financial losses on operators
Continuous input overflow Repeating inputs that exceed the context window
Resource-intensive queries Exhausting resources with computationally intensive requests
Model extraction via API Collecting outputs through bulk queries to replicate parts of a model
Functional model replication Using outputs as synthetic training data to create a model with equivalent functionality
Side-channel attacks Collecting model information using input filtering and similar mechanisms

In agents, the same thing occurs even without an attacker. Retries on tool errors, branching of subtasks, and loops where agents hand off work to each other exponentially increase costs. This is a case where the escalation described in ASI08 (Cascading Failures) of the OWASP Agentic Top 10 manifests in the form of cost. Denial of Wallet differs from conventional denial of service in that damage accumulates even while the service appears to be operating normally.

Budgets and cutoff mechanisms

OWASP LLM10 lists fifteen mitigations, including input validation, restricting logit and log-probability exposure, rate limiting, managing resource allocation, timeouts and throttling, logging, monitoring, and anomaly detection, watermarking, graceful degradation, access control, and centralized model inventories. OpenAI also guides that capping user input length and output token counts can reduce abuse.

The following controls are what application operators should establish first.

Control Details
Input and output caps Input size caps, output token caps
Request rates and quotas Requests per hour and daily/monthly token quotas by user, organization, or IP
Per-task budget Maximum number of model calls, tool calls, recursion depth, and cost for a single task
Timeouts Maximum execution time for tasks and tool calls
Concurrency and queue limits Number of tasks a single user can run concurrently
Circuit breaker Halting calls to a tool when the same error repeats a certain number of times
Graceful degradation Disabling expensive features first during overload to maintain core functionality

Distinguish between alerts and cutoffs. A cost alert merely notifies a human, and on a Friday night, no one may see it. A budget cap causes code to halt execution. To counter model extraction, as recommended by OWASP, restrict or obscure detailed probability exposure such as logit_bias and logprobs in API responses, and monitor per-account usage patterns. The OWASP AI Agent Security Cheat Sheet also recommends tracking per-session token usage and costs, and placing circuit breakers to prevent cascading failures.

Supply chain 1: Models and model files

OWASP LLM03 (Supply Chain) cites outdated third-party packages, licenses, end-of-life models, pre-trained models with hidden backdoors, weak provenance guarantees, malicious LoRA adapters, abuse during collaborative development, tampering with on-device models, and unclear terms of service as supply chain risks. Because models are opaque binary black boxes, static inspection alone has limitations in providing assurance.

Model file formats also present risks. Hugging Face documentation warns that arbitrary code can be executed when loading pickle files, the default format for PyTorch weights. While advising to load models only from trusted users and organizations and to verify provenance with signed commits, it adds that signatures only guarantee provenance, not file safety. It also states that the Hub's security scans are not exhaustive, and introduces the safetensors format, which was designed to store tensors safely, unlike pickle.

Design the adoption procedure in the following order:

  1. Review suppliers, data provenance, terms of service, and privacy policies, and re-examine them periodically.
  2. Use only models from verifiable sources, and verify integrity using signatures and file hashes.
  3. Open files that could execute code upon loading only in isolated environments.
  4. Verify through red-teaming and evaluations tailored to your specific use case rather than relying on benchmarks. This is because models can be fine-tuned to bypass public benchmarks (OWASP).
  5. Establish a patching policy and depend on APIs and models that are actively maintained.

Supply chain 2: Tools, plugins, and MCP servers

Agents invoke tools and other agents at runtime. Unlike LLM03, which focuses on static dependencies, ASI04 (Agentic Supply Chain Vulnerabilities) of the OWASP Agentic Top 10 addresses the risk of poisoning in tools, MCP servers, agent registries, and update channels that are composed at runtime. Even a tool reviewed during initial installation may become a different tool after an update.

The MCP security best practices specifically detail the risks of local MCP servers. Because a local server runs on the user's computer with the same privileges as the client, malicious startup commands or a malicious server can lead to arbitrary code execution and data exfiltration. Clients that allow one-click configuration of local servers must display the command to be executed in its full, untruncated form, disclose that it is a risky operation, and obtain explicit user consent. They recommend running server commands in a least-privilege sandbox and restricting file and network access.

There are four operational principles: pin the versions of tools and servers; compare changes in names, descriptions, parameters, and requested scopes during updates; approve them as if adopting a new tool whenever privileges expand; and prepare revocation procedures to sever connections and tokens at once if compromise is suspected.

Component specifications, AI BOM, and model lifecycles

To immediately answer during an incident "where and in which version is the problematic component being used?", an inventory must exist. OWASP LLM03 advises maintaining a signed, up-to-date SBOM (Software Bill of Materials) and examining an AI BOM (ML SBOM) that encompasses models and data, citing OWASP CycloneDX as a starting point. CycloneDX's ML-BOM is a format for representing datasets, models, and configurations of AI and machine learning systems and recording their provenance. In LLM applications, it is beneficial to also catalog prompts, tool definitions, connectors and permission scopes, classifiers, and the provenance of search indexes.

Models also have lifecycles. According to Anthropic documentation, each model ID points to a pinned version and the weights for that ID do not change (with the exception of aliases from earlier generations that track the latest snapshot), but serving infrastructure such as request routers or safety classifiers may change, which can slightly alter observed behavior. Models undergo deprecation before reaching retirement, and requests sent to retired models will fail. Anthropic notifies at least 60 days before the retirement of a public model and recommends testing applications with replacement models well before retirement. From a security perspective, model replacement is a condition for re-review from Chapter 1. Replace a model only after re-running the regression evaluation suite (Chapter 4) on the new model.

Designing detection signals

Detection that monitors signs of actual privilege abuse and damage lasts longer than detection that searches for suspicious phrases.

Signal Suspected scenario Owner
Repeated authorization failures Model repeatedly attempts to access resources outside its permissions Security Operations
Unrecognized external destination Exfiltration attempt, recipient manipulation Security Operations
External transmission immediately following bulk lookup Read-and-exfiltrate leak pattern Security Operations
Discrepancy between approval details and execution arguments Approval bypass, argument tampering Security Operations / Service Development
Sudden change in guardrail trigger rate New attack trend or increase in false positives AI Platform
Spike in tokens, costs, or iteration counts Denial of Wallet, agent runaway Service Operations

Because unowned alerts only pile up, designate an owner and an initial response action for every alert. Establishing baselines for goal states and tool usage patterns allows unexpected goal shifts or tool call sequences to be caught as anomalies (OWASP Agentic Top 10).

Incident response procedures

LLM incidents follow the same basic framework as standard security incidents, but unique elements are added: tool permissions, memory and indexes, and prompt and model versions. In April 2025, NIST published SP 800-61 Rev. 3, aligning its incident response recommendations with the Cybersecurity Framework (CSF) 2.0 and risk management activities. The Manage function of the NIST AI RMF also includes incident response, recovery, and communication plans, directing that incidents and errors be communicated to relevant entities.

Stage Actions in an LLM incident Items to prepare in advance
1. Detection and triage Receive alerts, usage anomalies, and user reports, distinguishing between response errors, attack attempts, and actual damage Reporting channels and designated reviewers (OpenAI recommendation), severity criteria
2. Containment Disable problematic tools, revoke connections and tokens, halt memory writes, and revoke keys suspected of exposure Tool-level kill switches, key revocation procedures
3. Scope determination Confirm affected sessions, users, data, time windows, and actions actually executed Audit logs linked by trace identifiers
4. Eradication Injection paths, excessive privileges, output handling flaws, cleaning up poisoned memory and indexes Component specifications, index rebuilding procedures
5. Verification and recovery Add the incident scenario to the regression suite, verify passing, and resume in phases Regression evaluation suite, recovery approver
6. Notification and retrospective Legal and contractual notifications, documenting timeline, root causes, and remediation measures Notification decision owner, retrospective template

Containment comes before scope determination. If a leak might be in progress, starting with log analysis allows damage to escalate in the meantime. Conversely, resuming operations hastily without confirming root causes reopens the same path. OpenAI recommends immediately revoking and replacing keys if there is a possibility they have been exposed or misused, and the OWASP Secrets Management Cheat Sheet warns that restarting an application does not revoke stolen credentials. The same document also recommends keeping secrets in centralized management tools with automated rotation enabled to expedite revocation and reissuance.

Kill switches and safe graceful degradation

A system with only a single "shut down entire service" option pays a steep cost even for minor incidents. Prepare kill switches by operational unit:

  1. Tool level: Disable only specific tools (sending, payments, external fetching).
  2. Connection level: Disconnect from specific MCP servers or connectors and revoke tokens.
  3. Feature level: Disable memory writes, external link rendering, or file uploads.
  4. Mode switching: Transition to a read-only mode or a pre-prepared static informational mode.
  5. Task level: Cancel queued tasks and abort running tasks.

For each switch, document in the runbook who can toggle it, what stops when it is turned off, and what happens to in-progress tasks, and test invoking them in practice regularly. Whether the "Stop" button on the user interface actually halts server-side tasks is also a subject of testing. Running through the runbook verbally each quarter in tabletop exercises without touching live systems exposes gaps such as "there is no switch to turn off a single tool" or "we do not know the vendor contact channels."

Personal information leak notification and documentation

When an LLM incident leads to a personal information leak, legal notification and reporting requirements arise. The contents of this section provide a decision-making framework and do not constitute legal advice. In an actual incident, the Personal Information Protection Officer and legal counsel make the determinations.

Article 34 of the Personal Information Protection Act (PIPA) requires a personal information controller, upon becoming aware of a leak, etc. (loss, theft, leakage, forging, alteration, or damage), to notify data subjects without delay of the items leaked, the timing and circumstances, measures data subjects can take to minimize harm, the controller's response actions and remediation procedures, the responsible department and contact information, and legal rights and methods for exercising them, such as claims for damages and dispute mediation. With the amendment entering into force on September 11, 2026, notification when becoming aware of the likelihood of a leak, etc., was newly added. The Enforcement Decree sets a deadline to provide this notification in writing or other prescribed methods within 72 hours (or immediately after the reason is resolved if emergency measures are necessary), and if specific details have not yet been confirmed, requires notifying what has been confirmed first before providing supplementary notices. Article 40 of the Enforcement Decree mandates reporting to the Personal Information Protection Commission or the Korea Internet & Security Agency within 72 hours of becoming aware if the leak falls under any of the following: information of 1,000 or more data subjects, sensitive information or unique identification information, or leaks caused by external illegal access. There are also provisions for deadline exceptions in justifiable circumstances, and a proviso stating that reporting may be waived if the likelihood of infringement on rights and interests has been significantly reduced through recovery or deletion. Information concerning health falls under sensitive information pursuant to Article 23 of the same Act.

There are two practical implications: To answer "what items, for how many individuals, and via what route" within 72 hours, audit logs to determine the scope must exist in advance; and because notification determinations may be required even before a leak is confirmed, include the Personal Information Protection Officer in the response structure from the earliest stage of an incident. NIST AI 600-1 also explains that logs, change management records, and version histories facilitate incident information sharing.

Inference server vulnerabilities: Decisions when no patch is available

For teams hosting models directly, inference servers require patching just like web servers. In 2026, remote code execution flaws and memory leak flaws in widely used inference servers were disclosed in succession.

Target Identifier Details Response
llama.cpp CVE-2026-34159 Unauthenticated remote code execution in RPC backend, b7991 and below No patched version in advisory. SECURITY.md states not to use the RPC backend in untrusted environments or networks
Ollama CVE-2026-7482 ('Bleeding Llama') Complete process memory disclosure without authentication Block external exposure, assume data handled by that process was exfiltrated, and determine scope
Ollama for Windows CVE-2026-42249 Remote code execution in update mechanism Manage update channels as attack vectors
vLLM GHSA-6757-hggm-hp2w (CVE-2026-115912) Forged multimodal shared-memory handle reaches worker's pickle.loads(), 0.25.1 and below Upgrade to 0.32.0

There are two principles: if a patch is unavailable or delayed, do not wait; disable that feature or isolate it from the network. Do not rely on a single setting; evaluate based on versions. Looking at the vLLM advisory released in October 2026, even on servers where unsafe deserialization was disabled, forged handles still reached the worker's pickle.loads().

For a research team tying three GPU servers together with llama.cpp RPC on an internal network, this issue cannot be solved with an update. The team must move the RPC ports to an isolated network reachable only between inference servers, or disable RPC and revert to a single-machine configuration. To immediately find which servers are running b7991 or below, an inventory is required. Beyond CycloneDX ML-BOM, models and datasets can also be documented using SPDX 3.0.1. SPDX 3.0.1 includes an AI profile containing the AIPackage class and EnergyConsumption-related classes. For datasets, there is a separate Dataset profile built on top of the Software profile.

Package publishing tokens and model signing

Shai-Hulud, first reported on GitHub on September 14, 2025, is a worm that self-replicated and spread across the npm ecosystem. Following this, publishing authentication in npm changed as follows:

Date Changes
2025-12-09 Permanent revocation of all classic tokens. Transition to two-hour session-based authentication and granular tokens; granular write token lifetime capped at a maximum of 90 days
2026-09-18 Introduction of stage-only granular tokens. Only version submission via npm stage publish is permitted; direct npm publish is rejected even if 2FA bypass is configured

The direction is singular: reduce the time and privileges available to an attacker if a token is compromised. If a team publishing internal SDKs places only stage-only tokens in CI, even if CI is breached, new versions halt at the submission stage. Public publishing remains the responsibility of an authorized person in charge.

The receiving side pairs with this as well. npm ci fails to run if a lockfile (package-lock.json or npm-shrinkwrap.json) is missing. Even if contents diverge from package.json, it stops with an error instead of modifying the lockfile. Unless a cooldown is configured separately, Dependabot applies a default three-day cooldown to version updates, but does not apply it to security updates. This means newly released versions are observed for several days, while security fixes are applied immediately.

Model files are handled on the same principle. On June 25, 2025, OpenSSF codified model signing formats into the OMS (OpenSSF Model Signing) standard. Signature files follow the Sigstore Bundle Format. Because OMS is not bound to a specific PKI, it supports key-only signing, certificate-based signing, and Sigstore keyless signing. Since the specification repository contains only specs, documentation, and tests without signing or verification programs, tooling must be selected separately. sigstore/model-transparency defaults to Sigstore keyless signing and also supports keys, certificates, and PKCS#11.

MCP 2026-07-28 revision: Logging and detection in a sessionless protocol

The MCP specification became stateless in the 2026-07-28 revision. In the Streamable HTTP transport, protocol-level sessions and the Mcp-Session-Id header were removed, and endpoints were consolidated into a single endpoint accepting only POST requests. Up through the 2025-11-25 version, session hijacking was an attack targeting the session ID issued by the server. At that time, security best practices advised against using sessions for authentication and recommended making session IDs secure and unpredictable. Now, operations teams must overhaul the rules that relied on session IDs.

Changes Operational rules to overhaul
ping, logging/setLevel, and notifications/roots/list_changed removed. Log level specified per request via io.modelcontextprotocol/logLevel in _meta Procedures that raised log levels once during investigations
subscriptions/listen instead of GET stream and resources/subscribe Subscription monitoring rules
Abolition of SSE resumption (Last-Event-ID) and retransmissions. Requests on broken streams disappear, and clients must resend with a new request ID Correlation rules that linked events by request ID
Resource missing error -32002 → -32602 (Invalid Params). Specification-reserved codes are -32020 to -32099 (e.g., HeaderMismatch -32020) Detection rules that flagged resource enumeration based on -32002 counts

The first area to address in logging is request IDs. Suppose the response stream dropped while calling an email-sending tool. The client resends the same call with a new request ID. If audit logs do not bind the two calls under a single trace identifier, the investigator cannot answer whether the email was sent once or twice. For tools that must never execute twice, such as sending or payments, deduplicate requests on the server side.

Going deeper

Balancing evidence preservation and personal information

Because investigations require the original text while personal information protection demands minimizing it, repositories are separated. Standard audit logs are retained long-term with masked structured fields, while original texts are kept in a separate evidence repository for a short period and viewed only through access approval. When an incident is declared, original texts for the relevant period are frozen in the evidence repository, and records of collection, inspection, and handoff are maintained. Analysis is performed on copies rather than originals, and integrity verification values are attached to the copies as well.

Because the sequence of events cannot be reconstructed if clocks differ across systems, time is synchronized to a single standard and events are linked using trace identifiers. Rules for investigation channels are also established so that pasting original texts into messengers or tickets during an investigation does not create secondary exposure.

Recovery from memory, index, and cache contamination

In agent incidents, contamination may persist even after the root cause is eliminated. Contaminated documents remain in indexes, "preferences" stemming from hidden instructions remain in long-term memory, and contaminated answers remain in response caches. Recovery is planned in the following order. First, stop write operations from the contamination source. Next, identify affected memory entries, index shards, and cache entries based on the contamination period and path. If provenance information is stored, this step becomes straightforward. The identified items are first isolated by removing them from search targets and then deleted, and the index is rebuilt from trusted sources to the required extent. Credentials issued or exposed during the contamination period are rotated. Finally, write operations are reopened after running regression evaluations with a scenario that reproduces the same contamination.

A repository that lacks an answer to Chapter 1's question, "How do you delete it when it is contaminated?" may have to be discarded entirely at this stage. A design that records provenance and creation timestamps in memory and indexes significantly reduces recovery costs.

At work

One Heart Dental Network: Debug logs were the leak path

While conducting a routine inspection of the reservation and consultation chatbot for the dental clinic network 'One Heart Dental Network', the person in charge discovered that debug logging, turned on three months earlier for a quality investigation, had been left on, and entire raw conversation transcripts were being transmitted to an external log analysis service. The conversations contained patients' names, contact information, pain areas, and treatment histories. Nearly twenty accounts, including employees of an outsourced development company, had access to the project in that log service.

The person in charge contained it first. They turned off debug logging, stopped external transmission, and reduced project access permissions to the minimum necessary personnel. Next, they tallied the transmission period, the number of transmitted conversations, and the number of unique patients, and used the log service's access records to verify who had viewed the logs during that period. Although there were no traces of illegal external access, sensitive medical information was in a state where individuals without a business need could access it.

The Personal Information Protection Officer and the legal team joined on the same day. Treatment histories could qualify as sensitive information, and under the Enforcement Decree, leaks of sensitive information could be subject to reporting regardless of the number of individuals affected. The legal team examined whether notification and reporting were required and reached a conclusion within 72 hours; the period, items, headcount, and viewing records compiled by the person in charge were used directly in that determination.

To eliminate the root cause, standard logs were configured to retain only masked structured fields (trace identifiers, tool names, determinations, token counts), and if original text was needed, it could only be stored in a restricted internal repository for up to two weeks upon approval. An expiration date was placed on debug settings, and outbound data was scheduled for quarterly reviews. In the retrospective, they recorded: "Logs are also sensitive data, and temporary settings must always have an expiration date."

Wave Media: Wallet exhaustion that occurred without an attacker

The content company 'Wave Media' used a research agent when drafting articles. The agent gathered materials using an external data search connector and delegated summarization tasks among subagents. Early one Tuesday morning, an alert was triggered indicating that 40% of the monthly budget had been spent in six hours. The alert was sent only via email, and no one saw it before coming to work in the morning.

When the on-duty staff member inspected the logs, there were no traces of an attack. The previous night, the search connector had been updated and its response format changed; unable to parse the response, the agent determined it to be a "search failure" and retried. With each retry, it launched a new subagent to assign the summarization again, and the subagent also called the same connector, failed, and retried. A single task snowballed into hundreds of model calls.

Containment was carried out in two steps. They disabled the connector connection and canceled all in-progress research tasks. It took time to confirm whether the cancel button actually stopped the subagents as well, because some child tasks continued running even after their parent task had been canceled. The team logged this as a separate defect.

Preventative measures focused on turning alerts into automated containment. They placed ceilings on the number of model calls, number of subagents, retry attempts, and cost per single task; applied exponential backoff to retry intervals; and installed a circuit breaker that blocked calls if five consecutive identical tool errors occurred. They fixed the system so that canceling a parent task also stopped child tasks. Connectors were pinned to specific versions, adopting only updates that passed response format comparisons and regression tests. When the organization's daily budget was reached, the research function was downgraded to a read-only summarization mode. In the retrospective, they wrote: "Unbounded consumption occurs even without malice," and "During hours when no one is watching, limits do the work, not alerts."

Common mistakes

  1. "Switching to a cheaper model resolves cost attacks." Even if unit costs decrease, costs continue to grow if requests are unbounded. The root cause is consumption without limits.
  2. "Setting a cost alert prevents wallet exhaustion." Alerts merely notify humans. During hours when no one is watching, you need limits enforced by code to stop execution.
  3. "Because a model is popular, it is verified." Download counts and benchmark scores are not proof of integrity. Verify through provenance, signatures, hashes, and evaluation for your specific use case.
  4. "Because the model ID is pinned, behavior will never change." Even when weights are fixed, behavior may shift slightly due to changes in serving infrastructure, and models are eventually retired. Run regression evaluations periodically.
  5. "The more logs you keep, the better." Logs are also sensitive data. You must determine what to record, what to mask, how long to retain, and who may view them.
  6. "Let's contain after identifying all causes." If damage is actively in progress, containment comes first. Root cause verification is completed before resumption.
  7. "To rotate a key, restarting the service is enough." Restarting does not revoke stolen credentials. Revocation and reissuance must be performed separately.

Summary at a glance

On the day before the exam, read each of the following sentences aloud to check your understanding:

  • Audit logs link when, where, who, and what, as well as input sources, tool calls, approvals, determinations, and versions using trace identifiers.
  • Exclude or mask tokens, passwords, keys, connection strings, and sensitive personal information from logs, and control tampering and viewing access.
  • Track abuse using hashed user identifiers and guardrail determination records.
  • Unbounded consumption may occur even without an attacker. Loops of retries, branching, and delegation inflate costs.
  • Alerts notify, while limits stop. Implement per-task budgets and circuit breakers.
  • Verify provenance, signatures, and hashes for model files, and handle formats capable of containing executable code in isolation.
  • Pin versions of tools and MCP servers, and review changes to descriptions, parameters, and scopes during updates.
  • The incident response framework consists of six phases, and if damage is in progress, cut it off before determining the full scope. Resumption occurs only after fixing the root cause and passing regression tests.
  • Prepare containment switches at the level of tools, connections, features, modes, and tasks, and test them in practice.
  • When a personal information leak is suspected, involve the Personal Information Protection Officer early to evaluate notification and reporting decisions against the 72-hour benchmark.

Check the official docs

Self-check

5-1. Based on the OWASP Logging Cheat Sheet, write four types of data that must be removed or masked from logs, and give one example of information that can be retained instead for investigation.

5-2. Explain the difference between a cost alert and a budget cap, and write two caps that can be placed on a single agent task.

5-3. Among the sub-risks of OWASP LLM10, distinguish between and explain "continuous input flooding" and "resource-intensive queries," and give one control appropriate for each.

5-4. Based on the explanation in Anthropic's documentation, write the reason why the behavior for the same prompt can change even when the model ID is fixed, and give one thing the operations team should do.

5-5. For a client that allows adding local MCP servers with one click, write two things it must do in accordance with MCP security best practices and state the recommended execution environment.

5-6. Write the three reportable events specified in Article 40 of the Enforcement Decree of the Personal Information Protection Act (PIPA) and the reporting deadline.

5-7. Design task: Design four kill switches to include in the incident response runbook for a consultation agent with long-term memory capabilities. For each switch, write what it turns off, who can turn it off, and what stops when it is turned off.

Hands-on tasks

Exercise

Building an LLM incident response runbook (50 minutes)

  1. Choose two incidents likely to occur in your service (e.g., tool misuse caused by indirect injection, cost surge caused by repeated agent invocations).
  2. For each incident, write down in a table the detection signals, cutoff measures (who, using which switch), log fields to use for scoping, candidate root causes, regression test items, and the person to contact for notification decisions.
  3. Verify whether the cutoff measures actually exist (per-tool switches, token revocation procedures, budget caps) and mark any that do not.
  4. Conduct a 15-minute tabletop exercise with a colleague and note any points where you got stuck.

Done when: Both incidents have at least one cutoff measure that can be executed within 5 minutes, and for any missing measures, the responsible person and the preparation deadline are written down.

Exercise

Writing an audit log field definition document (45 minutes)

  1. Referring to the table in this chapter, define the log fields that a single request will leave as a JSON example (trace identifier, input source, tool calls, approvals, decisions, versions, usage).
  2. For each field, determine masking rules (raw text, hash, masked, do not log), retention period, and access permissions.
  3. Verify whether the following five questions can be answered using only this log: When did it start? What was the input path? What tool was executed with what arguments? Who approved it? What were the model and prompt versions at that time?
  4. If there are questions that cannot be answered, add fields while finding a way to avoid leaving sensitive information in raw text.

Done when: All five questions can be answered, and not a single field leaves tokens, passwords, keys, or sensitive personal information in raw text.