AI Agent Provisioning for Automated Infrastructure Management
The Agent Provider enables provisioning and management of AI agents for infrastructure automation. Powered by the @enopax/resource-api framework, it provides AI-powered infrastructure management as a service through the Enopax platform.
Features:
- 🤖 Deploy AI agents for infrastructure automation
- 🔧 Configure agent capabilities and permissions
- 🧠 Integrate with Claude, OpenAI, or other LLM providers
- ⚙️ Create custom agent workflows
- 📊 Real-time monitoring and metrics
✅ Server Ready - v0.1.0
- ✅ Server implementation using
@enopax/resource-api - ✅ Provider API integration complete
- ✅ Settings page with JWT authentication
- ✅ Bash script structure in place
- 🚧 Agent container implementation (in progress)
- 🚧 LLM API integration (pending)
- Node.js 18+ and pnpm
- Docker (for agent containers)
- LLM API keys (Claude or OpenAI)
# Clone repository
git clone https://github.com/enopax/provider-agent.git
cd provider-agent
# Install dependencies
pnpm install
# Start server
pnpm dev
# Server runs on http://localhost:3002# Test provider discovery
curl http://localhost:3002/providers/info | json_pp
# Expected output:
# {
# "success": true,
# "providers": [{
# "typeId": "ai-agent",
# "displayName": "AI Agent",
# "endpoint": "/agents",
# ...
# }]
# }Via Platform UI:
- Navigate to Resources → Create Resource
- Select "AI Agent" provider
- Configure agent settings:
- Agent name
- LLM provider (Claude/OpenAI)
- Model selection
- Capabilities
- Click "Provision"
Via API:
curl -X POST http://localhost:3002/v1/agents \
-H "Content-Type: application/json" \
-d '{
"agentName": "cost-optimizer",
"llmProvider": "claude",
"model": "claude-3-5-sonnet-20250219",
"capabilities": ["cost-analysis", "resource-monitoring"],
"organizationId": "my_org",
"projectId": "production"
}'Response:
{
"success": true,
"id": "my_org-production-cost_optimizer-abc123de",
"name": "cost-optimizer",
"status": "provisioning",
"message": "Agent container created and starting",
"endpoint": "http://localhost:8080/agent/abc123de"
}curl http://localhost:3002/v1/agents/my_org-production-cost_optimizer-abc123deResponse:
{
"success": true,
"id": "my_org-production-cost_optimizer-abc123de",
"status": "active",
"health": "healthy",
"uptime": 86400,
"metrics": {
"tasksExecuted": 42,
"recommendationsGenerated": 15
}
}Via Platform UI:
- Navigate to agent resource
- Click "Settings" button
- Platform requests JWT token
- Settings page opens in new window
- Configure agent parameters
JWT Token Flow:
# 1. Request token
curl -X POST http://localhost:3002/v1/agents/:id/settings/token \
-H "Content-Type: application/json" \
-d '{"userId": "user_123", "resourceId": ":id"}'
# 2. Receive token
{
"url": "http://localhost:3002/v1/agents/:id/settings?token=JWT",
"token": "eyJ...",
"expiresAt": "2025-10-09T15:00:00Z"
}
# 3. Access settings page
open "http://localhost:3002/v1/agents/:id/settings?token=JWT"curl -X PUT http://localhost:3002/v1/agents/:id \
-H "Content-Type: application/json" \
-d '{
"model": "claude-3-opus-20240229",
"capabilities": ["cost-analysis", "scaling-recommendations"]
}'curl -X DELETE http://localhost:3002/v1/agents/:idAgents are configured via JSON schema:
{
"agentName": "infra-optimizer",
"llmProvider": "claude",
"model": "claude-3-5-sonnet-20250219",
"capabilities": [
"resource-monitoring",
"cost-analysis",
"scaling-recommendations",
"log-analysis"
],
"permissions": {
"resources": ["ipfs-*", "postgres-*"],
"actions": ["read", "recommend"]
},
"schedule": "0 */6 * * *"
}Server settings in server.js:
const app = createServer({
port: 3002, // Server port
host: 'localhost', // Server host
authentication: {
enabled: false, // Enable API key auth
apiKey: process.env.API_KEY || '' // API key
},
providers: [{
apiVersion: 'v1',
endpoint: '/agents',
scriptsFolder: './provider/agent/scripts'
}]
});| Method | Endpoint | Description |
|---|---|---|
GET |
/providers/info |
Discover provider metadata |
GET |
/v1/agents?org=...&project=... |
List agents |
POST |
/v1/agents |
Provision new agent |
GET |
/v1/agents/:id |
Get agent status |
GET |
/v1/agents/:id/metrics |
Get agent metrics |
PUT |
/v1/agents/:id |
Update agent |
DELETE |
/v1/agents/:id |
Deprovision agent |
POST |
/v1/agents/:id/settings/token |
Generate settings token |
GET |
/v1/agents/:id/settings?token=JWT |
Access settings page |
See provider/agent/config.json for the complete JSON Schema.
The Agent Provider uses a layered architecture:
- Server Layer: Express via
@enopax/resource-api - Provider Scripts: Bash scripts for lifecycle management
- Agent Containers: Docker containers running AI agents
- LLM Integration: API calls to Claude/OpenAI
- Custom Endpoints: Vue.js pages for configuration
See docs/architecture.md for detailed architecture documentation.
provider-agent/
├── server.js # Server using @enopax/resource-api
├── package.json # Dependencies and scripts
├── provider/
│ └── agent/
│ ├── config.json # Provider configuration
│ ├── scripts/ # Lifecycle scripts
│ │ ├── provision.sh
│ │ ├── list.sh
│ │ ├── status.sh
│ │ ├── metrics.sh
│ │ ├── update.sh
│ │ ├── deprovision.sh
│ │ └── settings/ # Settings endpoint scripts
│ │ ├── get-settings.sh
│ │ └── save-settings.sh
│ └── pages/ # Custom endpoint pages
│ └── settings/
│ ├── index.html
│ └── app.js
├── docs/
│ ├── concept.md # Core concepts
│ └── architecture.md # System architecture
├── CHANGELOG.md # Version history
├── CLAUDE.md # AI assistant guidance
└── README.md # This file
- Auto-scaling: Monitor usage and provision resources proactively
- Self-healing: Detect failures and automatically remediate
- Cost optimization: Identify underutilized resources and suggest optimizations
- Deployment automation: Orchestrate complex deployment workflows
- Log analysis: Monitor logs and alert on anomalies
- Performance tuning: Analyse metrics and suggest improvements
- Security monitoring: Scan for vulnerabilities and unusual patterns
- Compliance checking: Validate against policies and generate reports
- Audit trail: Track all infrastructure changes
See docs/concept.md for detailed use cases.
- Node.js 18+
- pnpm
- Docker Desktop
- Git
# Clone repository
git clone https://github.com/enopax/provider-agent.git
cd provider-agent
# Install dependencies
pnpm install
# Start development server
pnpm dev# Test provision script manually
echo '{"agentName":"test","llmProvider":"claude"}' | \
bash provider/agent/scripts/provision.sh
# Test status script
echo '{"id":"org-proj-agent-abc123"}' | \
bash provider/agent/scripts/status.sh# Unit tests (when implemented)
pnpm test
# Integration tests (when implemented)
pnpm test:integration- Concept - Core concepts and philosophy
- Architecture - System architecture and design
- CLAUDE.md - AI assistant guidance
- CHANGELOG.md - Version history
- Each agent runs in isolated Docker container
- No host system access
- Resource quotas and limits enforced
- Explicit resource patterns (
ipfs-*,postgres-*) - Action allow-list (
read,recommend,update) - Approval workflow for sensitive actions
- Optional API key authentication
- JWT tokens for custom endpoints (5 min expiry)
- Audit logging for all actions
See security considerations in docs/concept.md.
- Agent container implementation
- Claude API integration
- Basic workflow execution
- Docker deployment
- OpenAI API integration
- Advanced workflow engine
- Multi-agent coordination
- Enhanced monitoring
- Production-ready deployment
- Kubernetes support
- Enterprise features
- Comprehensive testing
See CHANGELOG.md for version history.
Contributions welcome! Please:
- Fork the repository
- Create a feature branch (
git checkout -b feat/amazing-feature) - Commit your changes (
git commit -m 'feat: add amazing feature') - Push to the branch (
git push origin feat/amazing-feature) - Open a Pull Request
Follow semantic commit messages and PR specifications.
- Issues: GitHub Issues
- Documentation:
docs/ - Email: [email protected]
MIT
- Built with
@enopax/resource-api - Part of the Enopax ecosystem
- Powered by Anthropic Claude and OpenAI APIs
Status: Server ready • Agent implementation in progress • v0.1.0