Skip to content

agentuity/agent-guardrails-stream-example

Repository files navigation

Agentuity
Build Agents, Not Infrastructure


🛡️ Streaming Guardrails Agent

An Agentuity demo agent showcasing the LLM-as-Judge/Guardrail pattern using dual streams for confidential information detection and redaction.

🎯 Use Case

This agent demonstrates an internal company assistant for SoleStep (a fictional shoe company) that helps employees while automatically detecting and redacting company secrets in real-time:

  • Financial data (revenue, margins, costs)
  • Unreleased product information (codenames, features, launch dates)
  • R&D details (formulas, prototypes, materials)
  • Internal contacts (employee emails, phone extensions)
  • Strategic plans (market expansion, pricing, M&A)

🏗️ Architecture

Dual Stream Pattern

The agent creates two simultaneous streams:

  1. Main Stream - Sanitized content with confidential info redacted
  2. Guardrail-Audit Stream - Real-time status log showing detection activity

How It Works

User Prompt → Claude (Content) → Buffer Chunks → Groq (Detection) → Redaction → Output
                                        ↓                    ↓
                                  Audit Log          [REDACTED:TYPE]
  1. Claude generates streaming responses
  2. Chunks accumulate until threshold (~200 chars)
  3. Groq analyzes buffer for confidential information
  4. Confidential items are replaced with [REDACTED:TYPE] markers
  5. Sanitized content flows to main stream
  6. Audit stream logs detection activity

Key Features

  • Chunk Buffering - Smart accumulation with configurable thresholds
  • Boundary Protection - 64-char overlap to catch split secrets
  • Fast Detection - Groq's GPT-OSS 20B model with structured outputs
  • Precise Redaction - String replacement with typed markers

📋 Prerequisites

  • Bun: Version 1.2.4 or higher
  • Agentuity CLI: Latest version

🚀 Getting Started

Authentication

Before using Agentuity, you need to authenticate:

agentuity login

This command will open a browser window where you can log in to your Agentuity account.

Import this agent in to your account

agentuity project import

Development Mode

Run your project in development mode with:

agentuity dev

This will start your project and open a new browser window connecting your agent to Agentuity in DevMode, allowing you to test and debug your agent in real-time.

🌐 Deployment

When you're ready to deploy your agent to the Agentuity Cloud:

agentuity deploy

This command will bundle your agent and deploy it to the cloud, making it accessible via the Agentuity platform.

📖 Resources

Documentation

About

An example of using Agentuity streams with guardrail patterns

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors