AgentWall SDK Examples

AgentWall SDK Examples

Production-ready code examples for integrating AgentWall with your AI agent applications.

📚 Documentation

🚀 Quick Start

Python

JavaScript

🎯 Key Features

Run-Level Tracking

Track multi-step agent tasks with a single run ID:

Loop Detection

Automatically blocks infinite loops:

Streaming Responses

Real-time output for long-running tasks:

Budget Tracking

Monitor costs in real-time:

🔗 Framework Integrations

Python

  • LangChain - Use AgentWall as OpenAI proxy
  • CrewAI - Multi-agent orchestration
  • AutoGen - Microsoft's agent framework

JavaScript

  • LangChain.js - TypeScript agent framework
  • React - Real-time chat UI
  • Node.js - Server-side agents

📖 Learning Path

  1. Start: SDK Overview
  2. Choose Language: Python or JavaScript
  3. Pick Framework: LangChain, CrewAI, React, etc.
  4. Explore: API Reference
  5. Deploy: Getting Started

🛡️ Security Best Practices

  1. Never hardcode API keys - Use environment variables
  2. Use HTTPS only - Always use secure connections
  3. Rotate keys regularly - Change keys periodically
  4. Validate responses - Check response structure
  5. Handle sensitive data - Be careful with PII

⚡ Performance Tips

  1. Reuse client instances - Don't create new clients per request
  2. Use streaming - For long responses
  3. Implement caching - Cache responses when appropriate
  4. Monitor latency - Track response times
  5. Use connection pooling - For high-volume apps

🐛 Troubleshooting

Loop Detection (429)

  • Check if sending same prompt repeatedly
  • Use different run IDs for different tasks
  • Verify agent logic isn't stuck in loop

Authentication (401)

  • Verify API key is correct
  • Check key hasn't been revoked
  • Ensure key in Authorization header

Timeout Issues

  • Increase timeout value
  • Check network connection
  • Verify API responding (/health endpoint)

📊 Example Projects

Python: Multi-Step Analysis

JavaScript: Real-Time Chat

📞 Support

📝 License

MIT License - See LICENSE file for details


Motto: Guard the Agent, Save the Budget 🛡️

Version: 1.0.0
Last Updated: January 7, 2026