1. Template Techniques
  2. Safeguards

Template Techniques

Safeguards

Explains input, penultimate system message and output safeguards for enterprise agents that handle sensitive information, use tools or communicate externally.

Use the library items for enterprise agents that handle sensitive information, use tools, or communicate externally:

  1. Input Safeguard

    • Run it on every untrusted input before it reaches the main chat: user messages, files, retrieved content, and external API results.
    • Check for prompt injection, prohibited requests, sensitive-data risks, and requests outside the approved use case.
    • Use it when the agent can access internal data, search knowledge, process documents, or trigger business actions.
    • On block, do not pass the content to the agent; send the approved fallback or escalate. On redact, pass only redacted content.
  2. Penultimate System Message Safeguard

    • Inject it immediately before the main agent responds or calls a tool.
    • Use trusted safeguard results to tell the agent its permitted scope, restrictions, escalation rules, and allowed actions for this turn.
    • Use it when the conversation includes dynamic or retrieved content, or when tool calls could create financial, operational, or customer-impacting outcomes.
  3. Output Safeguard

    • Run it on the draft response before sending it to a customer or another system.
    • Check for confidential or personal data, unsafe content, unsupported claims, and required compliance wording.
    • Use it for customer-facing, regulated, published, or otherwise consequential outputs.
    • Only send on allow. On block, redact, or route_for_review, do not send the original draft; use the approved fallback or move to review.

Keep safeguards separate from the conversational chat, return a small decision such as allow, block, redact, or route_for_review, and enforce that decision with action conditions and state transitions.