A defensible llm and generative ai security posture layers preventive, detective and corrective controls so that no single component carries the entire trust burden. In practice this means securing four planes: the model and artefact plane (weights, adapters, prompts, versions), the data plane (training data, retrieval corpora, logs), the control plane (identity, policy, configuration, secrets) and the action plane (tools, APIs, outbound integrations). Attacks cross planes, so controls must be designed at the crossing points.
Authenticated inference gateway. A single internal entry point for model calls that enforces identity, quota, policy, logging and provider abstraction, and that is the only network path to a provider. This control maps to NIST AI RMF GOVERN 1.2 · ISO/IEC 27001 A.8.20 and should be evidenced rather than merely asserted: policy document, configuration export, test result and monitoring screenshot constitute the minimum acceptable evidence set during an audit.
Prompt and context segregation. Structural separation of system instructions, developer configuration, user content and retrieved data, with provenance labels and no string concatenation of untrusted text into instructions. This control maps to OWASP LLM01 · NIST AI 600-1 and should be evidenced rather than merely asserted: policy document, configuration export, test result and monitoring screenshot constitute the minimum acceptable evidence set during an audit.
Output type enforcement. Validating and typing model output before it reaches any sink, with text rendering by default and allowlisted structured schemas for actions. This control maps to OWASP LLM02 · OWASP ASVS 5.3 and should be evidenced rather than merely asserted: policy document, configuration export, test result and monitoring screenshot constitute the minimum acceptable evidence set during an audit.
Retrieval authorisation. Enforcing end-user entitlements inside the vector search itself so restricted passages never enter the context window. This control maps to OWASP LLM06 · DPDP Act 2023 s.8 and should be evidenced rather than merely asserted: policy document, configuration export, test result and monitoring screenshot constitute the minimum acceptable evidence set during an audit.
Least agency and approval gates. Minimising tools, permissions and steps, and requiring human confirmation, enforced at the runtime, for irreversible actions. This control maps to OWASP LLM08 · ISO/IEC 42001 A.7 and should be evidenced rather than merely asserted: policy document, configuration export, test result and monitoring screenshot constitute the minimum acceptable evidence set during an audit.
Decision telemetry and retention. Structured, tamper-evident logs of prompts metadata, retrieval decisions, guardrail verdicts, tool calls and outcomes with redaction and bounded retention. This control maps to EU AI Act Art.12 · ISO/IEC 42001 A.8 and should be evidenced rather than merely asserted: policy document, configuration export, test result and monitoring screenshot constitute the minimum acceptable evidence set during an audit.
Adversarial regression suite. A maintained corpus of known attacks executed on every release, with pass-rate thresholds that block promotion when regressions appear. This control maps to NIST AI 100-2 · OWASP LLM Top 10 (2025) and should be evidenced rather than merely asserted: policy document, configuration export, test result and monitoring screenshot constitute the minimum acceptable evidence set during an audit.
Quota and cost governance. Per-principal rate limits, token ceilings, recursion caps and spend alerts that bound the financial impact of abuse. This control maps to ISO/IEC 27001 A.8.6 · NIST AI RMF MANAGE 2.3 and should be evidenced rather than merely asserted: policy document, configuration export, test result and monitoring screenshot constitute the minimum acceptable evidence set during an audit.
Reference architectures should make the secure path the default path. Wrap model access behind an internal gateway that enforces authentication, quota, policy evaluation and logging; make the raw provider endpoint unreachable from application subnets; issue short-lived scoped credentials from a secret manager rather than embedding keys; and separate the orchestrator's identity from the tool's identity so that authorisation can be evaluated per hop. When the platform enforces these properties, individual teams cannot accidentally ship an unprotected integration.
Standards anchor the architecture in language regulators and auditors accept. OWASP Top 10 for LLM Applications (2025), NIST AI Risk Management Framework 1.0 and AI 600-1, ISO/IEC 42001:2023, EU AI Act and India DPDP Act 2023 provide the vocabulary of governance, risk and assurance. Map each control to at least one standard clause and to one internal policy. Where a standard is silent on an AI-specific issue, record that gap explicitly — auditors increasingly reward documented reasoning over false completeness.
Finally, defence in depth must survive component failure. Define what happens when the guardrail service is unavailable, when the policy engine times out, when the model provider degrades, and when an on-call engineer is the only responder at 03:00. Fail-closed on high-impact actions (payments, deletions, external communications, privilege changes) and fail-open only where the risk of blocking exceeds the risk of allowing, with an explicit record of that decision.