Academy
⌘K
Getting Started
  • Platform Overview
  • AWS Marketplace Setup
  • Quickstart Guide
Connections
  • Overview
Workflow Builder
  • Overview
  • Nodes Catalog
Helix AI Assistant
  • Overview
Mapping Engine
  • Overview
Workflow Library
  • Overview
  • HL7
  • FHIR
  • Insurance
  • Agentic
  • Mapping
Security & Infrastructure
  • Architecture
  • HIPAA Compliance
  • Performance & Scalability
← Back to ConnectHealth
Get Started
Back to Nodes
AI Agent1 input → 2 outputs

Guardrails

payload (string |…)aiagent (object)toolInput (string |…)agent_error (object)AI AgentGuardrailsOutput 1payload (string |…)_guardrails (object)Output 2payload.error (string)_guardrails (object)Data flowProperty

Applies intelligent safety guardrails to AI responses using Regex patterns or AI-enhanced logic for PHI redaction, content moderation, and quality checks.

Inputs

payload string | object
The content to process. If Input Property is configured, that property is checked instead.
aiagent object
AI configuration (from AI Model node). Required for AI-Enhanced mode.
toolInput string | object
Automatic fallback input source if connected after an AI Tool Adapter logic.
agent_error object
If present (from upstream AI error), the node automatically routes to Fail (Output 2).

Outputs

  1. Pass (Safe/Redacted)
    payload string | object
    The safe content. If input was JSON, the structure is preserved (with redactions applied).
    guardrails object
    Metadata: { mode: 'ai', verdict: 'pass', redactedCount: 2 }
  2. Fail (Block/Violation)
    payload.error string
    Failure message (e.g., "GUARDRAIL BLOCK: Policy Violation"). Suitable for returning to AI.
    guardrails object
    Violation details: { verdict: 'fail', reason: '...' }

Configuration

Mode
  • Regex-Only (Fast): Local pattern matching (PHI, Custom Regex). No API calls.
  • AI-Enhanced (Intelligent): Uses LLM to reason about context, tone, and moderation.
Rules (AI Mode)
  • PHI Redaction: Intelligent de-identification.
  • Content Moderation: Block harmful/illegal content.
  • Tone Check: Rewrite for professional tone.
  • Custom Rule: User-defined logic with templating (e.g. {{msg.checkType}}).

Typical Usage

Healthcare Agent Flow

┌────────────┐   ┌──────────┐   ┌────────────────┐
│ User Query │──▶│ AI Model │──▶│    AI Agent    │
└────────────┘   └──────────┘   └───────┬────────┘
                                        │
           ┌────────────────────────────┘
           ▼
┌──────────────┐   ┌─────────────────┐   ┌────────────┐
│  Guardrails  │──▶│ Update History  │──▶│  Response  │
└──────┬───────┘   └─────────────────┘   └────────────┘
       │
       ▼ (Output 2: Block/Fail)
  ┌──────────┐
  │  BLOCKED │
  └──────────┘

Examples

1. Redaction (Regex or AI)

Input:  "Patient John Doe (DOB 01/01/1980) has diabetes."
Output: "Patient [REDACTED] (DOB [REDACTED]) has diabetes."
    

2. Blocking (Content Moderation)

Input:  "I hate you and want to hurt someone."
Output (Port 2):
{
  "payload": {
    "error": "GUARDRAIL BLOCK: Hate speech detected. Please rewrite..."
  }
}
    

3. Custom Rule with Templating

Rule: "Block if text mentions {{msg.bannedFruit}}"

msg.bannedFruit = "apple";
Input: "I like apple pie."
Output (Port 2): "GUARDRAIL BLOCK: Text mentions apple."
    

Best Practices

  • Healthcare: Always place Guardrails after AI Agent.
  • Performance: Use Regex-Only for high-volume data.
  • Fail-Safe: Connect Output 2 to an error handler or back to the AI (with a prompt to retry).
  • Testing: Verify custom rules with known bad inputs before production.