AI security

    AI security is application security where the untrusted input can rewrite the program. The useful mental model is authority: what the model can do, on whose behalf, and what confirms the action.

    Updated

    Threat classes that matter in production

    • Indirect prompt injection through retrieved documents, web pages, tickets or emails the model reads — still the top-ranked risk in the OWASP Top 10 for LLM Applications (LLM01:2025), now explicitly covering multimodal payloads in images, audio and files.
    • Excessive agency: agents holding broader credentials than the requesting user, and system-prompt leakage that exposes the tool schema an attacker needs to abuse it.
    • Cross-tenant leakage in retrieval indexes, embeddings and caches — its own OWASP category since the 2025 revision (LLM08: Vector and Embedding Weaknesses).
    • Insecure output handling — model text rendered into HTML, SQL, shell or a downstream API call.
    • Sensitive data flowing to inference providers without redaction or a data-processing basis.
    • Cost and availability abuse through unbounded token consumption, denial-of-wallet against metered APIs.
    • In agentic deployments: goal hijack, tool misuse, memory poisoning and unauthenticated inter-agent messages — the categories OWASP's 2026 Top 10 for Agentic Applications now names directly.

    1Untrusted inputs

    • User prompt
    • Retrieved documents
    • Web / email content
    • Tool responses

    2Trust boundary

    • Input normalisation
    • PII redaction
    • Data / instruction separation

    3Model + tools

    • System prompt
    • Delegated user tokens
    • Confirmation on writes
    • Step and budget limits

    4Outputs

    • Contextual encoding
    • Schema validation
    • URL / image containment
    • Audit log
    STRIDE mapped onto an LLM application

    Layered controls

    LayerControlFailure it prevents
    InputNormalisation, length limits, PII strippingInjection payloads, data leakage to provider
    RetrievalPer-tenant scoping, source labellingCross-tenant disclosure, poisoned context
    ModelHardened system prompt, refusal policyInstruction override, persona hijack, prompt leakage
    Tools / agentsLeast-privilege, short-lived scoped credentials, human confirmation for writesExcessive agency, destructive actions, identity abuse
    OutputContextual encoding, schema validationXSS, injection into downstream systems
    RuntimeRate limits, quotas, audit logging, behavioural baselinesCost abuse, undetected misuse, rogue or drifting agents

    Two taxonomies do most of the heavy lifting when I scope a review: the OWASP Top 10 for LLM Applications for single-model and RAG risk, and the OWASP Top 10 for Agentic Applications for systems where agents plan, hold memory and call tools with delegated authority. NIST's Generative AI Profile (NIST AI 600-1) supplies a complementary risk catalogue — covering confabulation, information integrity and value-chain exposure — for teams running a formal AI RMF programme rather than a point-in-time assessment.

    Frequently asked questions

    Can prompt injection be fully solved?

    No. Treat model output as untrusted and constrain what actions it can trigger; that turns injection from a breach into a nuisance.

    Do guardrail products help?

    They raise the cost of trivial attacks. They do not substitute for authorisation design.

    Is agentic AI a different threat model?

    Agents add delegated authority, memory and inter-agent messaging to the same underlying weaknesses, so identity, tool scoping and behavioural monitoring matter as much as prompt hygiene.