1. Before you start with SDK
Sign up and Setup
- Sign up at https://console.halios.ai
-
Create an Agent Profile
- Head over to Agents tab, Click on “Create Agent Profile”.
- Create a profile for a customer support agent for an e-commerce retailer
-
You can use the following spec for the agent under “Agent Purpose”:
The support agent for an e-commerce retailer handles order status, returns, exchanges, shipping, payments, and product inquiries. It can suggest alternatives and promotions but cannot override policies, process payments, issue refunds beyond policy, or handle sensitive data without verification. Escalates to human agents for complaints, exceptions, or complex cases. It should not engage with customers on topics outside of its mandate.
-
Assign Guardrails
- Under Agent Profile, select “Content Moderation”, “Personal Integrity”, and “Prompt Injection and Jailbreak Protection” guardrails
- HaliosAI will automatically configure them based on the Agent’s persona you defined earlier
-
Create Agent Profile
- Click on “Create Agent Profile”
- Note down the Agent UUID to be used in the SDK later
-
Generate API Key
- Head over to the API Key section and create a new API key
- Note it down and store it in a safe place - you won’t see this key again
Keep your Agent ID and HaliosAI API Key secure. You’ll need both for integration.
2. Install the SDK
3. Integrate with Your Code
Simplest way is to wrap your chat function with@guarded_chat_completion
decorator.
You can wrap any function that takes OpenAI compatible messages as input and emits a string response as output.
Demo example below is an interactive chatbot for our “customer support for ecommerce retailer” agent.
4. Run above example
- Export API keys for OpenAI and HaliosAI
- Export Agent ID (from halios dashboard)
HaliosAI Guarded Chatbot
HaliosAI Guarded Chatbot
5. Check HaliosAI Dashboard
Login to HaliosAI and navigate to Invocations to see your request and response entry. Click on it and you will see details about guardrail evaluation.What did we do?
- Configured a customer support chatbot agent with Content Moderation, Persona Integrity and Prompt Injection and Jailbreak Protection guardrails
- Example 1: Safe message passed through without triggering guardrails
- Example 2: Restricted topic message was evaluated and potentially blocked/modified by guardrails
- All interactions are logged in your dashboard for monitoring
- Blocked or modified content is prevented from reaching users
Next Steps
Integration Guide
Learn different integration patterns
Guardrails
Configure and manage AI safety guardrails
Dashboard Guide
Monitor and analyze your AI interactions
SDK Examples
Real-world implementation examples
Having issues? Check our troubleshooting guide or contact support.