Skip to main content

What would you log from an LLM application for security, and which signs of abuse would you build detections for?

AI security · Pro 1

Short answer

Log who called, when, the prompt and response, retrieved documents, tool calls with arguments, guardrail decisions, tokens and cost. Detect repeated jailbreak or injection attempts, attempts to extract the system prompt, unusual volume or spend per user, denied tool calls, and outputs that contain secrets or personal data. Protect the logs and send the events to the SIEM.

Deeper answer

For an LLM app the attack is inside the text and in what the model then does, so I need the content and the actions: prompts, retrieved chunks and tool calls, tied to an authenticated user and a session. Prompts often contain personal data, so the logs themselves are sensitive: restrict access, mask where possible and set retention.

Detections then follow the threats. Many guardrail blocks from one account suggest someone probing for a jailbreak. A high volume of systematic queries can mean model extraction or scraping of the knowledge base. A spike in tokens can be a stolen key or an attack that aims to increase our bill. A tool call that was denied, or a tool sequence never seen before, can mean a successful injection. I would start with a few high-signal rules, send them to the SIEM with user and session fields so analysts can correlate with other logs, and tune for false positives. Interviewers listen for tool-call logging, privacy of logs and concrete detections.

What a strong answer covers

Answer it out loud in the mock interview about 2.5 min

Follow-ups to expect

Common mistakes

Learn it

Logs and SIEM

Practice AI security questions

More on this topic

Today's AI turns are used

Lessons, roadmaps, videos, practice cards and the code playground stay free with your account, with no limit.