Agentic DevOps
repository·main·Indexed 42 days ago
https://github.com/agenticsorg/devopsAn autonomous, AI-powered platform for managing cloud infrastructure using OpenAI's Agents SDK. It provides a Python API and CLI for intelligent, self-healing, and predictive DevOps operations across AWS and GitHub, featuring specialized agents for EC2, S3, and repository management coordinated by an Orchestrator Agent.
What's inside Agentic DevOps
- The Agentic DevOps technical documentation provides a comprehensive guide to the framework's architecture, implementation, APIs, and deployment strategies. Developers can use this documentation to understand how the system integrates with AWS, GitHub, and OpenAI Agents, as well as how to deploy the framework via AWS Lambda, Docker, or Llama.
Overview of the rUvix technology stack
mainThe rUvix terminal interface is built using the following modern web technologies:
- Vite: Build tool
- TypeScript: Type-safe programming
- React: UI library
- shadcn-ui: Component library
- Tailwind CSS: Utility-first CSS framework
What is Agentic DevOps?
mainAgentic DevOps is an autonomous, AI-powered platform designed for managing cloud infrastructure across multiple providers. Unlike traditional automation, it uses AI-driven decision-making to independently plan, execute, and optimize the entire infrastructure lifecycle. It is powered by OpenAI's Agents SDK and currently features primary support for AWS and GitHub integration.Project Structure and Dependencies
mainThe DevOps agent is organized into service-specific implementations (AWS, GitHub) and core agent logic.
Core Directory Structure
src/aws/: AWS service implementations (EC2, IAM, S3, VPC).src/github/: GitHub service implementations.src/core/: Core agent logic includingagent.py,config.py,context.py,guardrails.py, andtracing.py.examples/: Implementation examples for EC2, GitHub, and deployment workflows.tests/: Test suites for AWS, GitHub, and core functionality.
Key Dependencies
boto3: AWS SDK for PythonPyGithub: GitHub API clientpydantic: Data validation and settings managementopenai-agents: OpenAI Agents SDKmoto: AWS mocking librarypytest: Testing framework
Understand the Agentic DevOps project structure
mainThe project is organized into several functional domains that allow for both manual DevOps operations and autonomous agentic workflows:
src/aws/: Modules for managing AWS services like EC2, S3, VPC, IAM, CloudFormation, Lambda, ECS, and RDS.src/github/: Integration for GitHub issues, repositories, and Actions.src/autonomous/: Core autonomous logic including deployment, resource optimization, monitoring, and learning systems.src/agents/: Integration with OpenAI Agents, including specific tools for EC2, S3, and GitHub.src/core/: Foundational logic for configuration, credentials, context, logging, and security guardrails.cli/: Command-line interface entry points for AWS, GitHub, and deployment commands.examples/: Reference scripts for using AWS services and OpenAI Agents.
Manage EC2 instances with the AWS module
mainTheawsmodule provides tools for interacting with Amazon Web Services, specifically focusing on theec2submodule. You can use this submodule to list, start, stop, create, and terminate EC2 instances, as well as deploy applications from GitHub to EC2 instances.Implement security with Guardrails
mainTheguardrailssubmodule provides security functionalities to ensure agent actions remain within safe and defined boundaries. (Note: Detailed implementation details are located in theopenai-agents-integration.mddocumentation).Core capabilities of Agentic DevOps
mainAgentic DevOps provides several categories of autonomous and intelligent services:
- Autonomous Infrastructure Management: Self-provisioning, automatic scaling, resource optimization, and anomaly remediation.
- Intelligent Agents: Specialized agents that collaborate, maintain contextual awareness of infrastructure state, and use reasoning for complex problem-solving.
- Natural Language Interaction: Managing infrastructure via conversational commands and plain English instructions.
- Multi-Cloud Support: Unified interface for AWS (primary), with planned support for Azure, Google Cloud, and DigitalOcean.
- Security and Compliance: Secure credential management (via keyring integration), least privilege enforcement, and automated vulnerability scanning.
- Observability and Monitoring: Resource health, performance metrics, cost tracking, and root cause determination.
- Deployment Automation: CI/CD integration, blue/green and canary deployment strategies, and automated rollbacks.
- Disaster Recovery: Automated backups, cross-region replication, and failover automation.
- Workflow Orchestration: Multi-step automation with conditional paths and human-in-the-loop approvals.
- Knowledge Management: Automated runbook generation and self-documenting operations.
Understand the Agentic DevOps High-Level Architecture
mainThe Agentic DevOps framework is a modular system designed to automate DevOps workflows using AI agents. It is composed of five primary layers that interact to manage infrastructure, code, and intelligent task execution:
- Core Module: Manages configuration, credentials, context, and safety guardrails.
- AWS Integration: Provides connectivity to AWS services such as EC2, S3, and IAM.
- GitHub Integration: Manages code-related operations including Repositories, Pull Requests (PRs), and Issues.
- OpenAI Agents Integration: Uses the OpenAI Agents SDK to deploy intelligent agents equipped with tools and guardrails.
- CLI Layer: The entry point for users to interact with the system via command handlers.
GitHub Module components and responsibilities
mainThe
github/module provides tools for interacting with GitHub:- GitHub Service (
github.py): Manages repositories, issues, and pull requests via theGitHubServiceclass. - GitHub Tools (
github_tools.py): Contains helper functions and tools for GitHub operations. - GitHub Models (
github_models.py): Defines data structures for GitHub resources, includingGitHubRepository,GitHubIssue,GitHubPullRequest,GitHubRepoRequest,GitHubIssueRequest, andGitHubPRRequest.
- GitHub Service (
Implement Multi-Agent Workflows
mainThe framework supports three types of multi-agent coordination:
- Handoffs: Agents can delegate tasks to other specialized agents using the
handoffsparameter in theAgentconstructor. - Sequential Execution: Running multiple agents in a chain where the output of one is passed to the next.
- Parallel Execution: Running multiple agents simultaneously using
asyncio.gather.
# 1. Handoffs orchestrator_agent = Agent( name="Orchestrator", instructions="...", handoffs=[ {"agent": infrastructure_agent, "description": "Handles infrastructure tasks"}, {"agent": deployment_agent, "description": "Handles deployment tasks"} ] ) # 2. Sequential Execution infra_result = await Runner.run(infrastructure_agent, "Prepare the infrastructure") deploy_result = await Runner.run(deployment_agent, f"Deploy using {infra_result.final_output}") # 3. Parallel Execution infra_task = asyncio.create_task(Runner.run(infrastructure_agent, "Prepare the infrastructure")) code_task = asyncio.create_task(Runner.run(code_agent, "Prepare the code")) infra_result, code_result = await asyncio.gather(infra_task, code_task)- Handoffs: Agents can delegate tasks to other specialized agents using the
How the OpenAI Agents integration works
mainThe Agentic DevOps framework integrates with the OpenAI Agents SDK to automate complex DevOps workflows through specialized agents. The architecture is composed of five key pillars:
- Agent Factory: Creates and configures specialized agents (infrastructure, code, deployment, security) using templates and handoff mechanisms.
- Tool Registry: Manages tools for interacting with external systems like AWS and GitHub. Tools must be
asyncfunctions with type annotations. - Guardrail System: Ensures safety via input validation, output filtering, and operation restrictions.
- Context Management: Provides environmental data (user, AWS region, GitHub repo) to agents.
- Runner: The execution engine that handles agent initialization, tool execution, handoffs, and result formatting.
┌─────────────────────────────────────────────────────────────────┐ │ Agentic DevOps Framework └───────────────────────────────┬─────────────────────────────────┘ │ ▼ ┌─────────────────────────────────────────────────────────────────┐ │ OpenAI Agents Integration ├─────────────┬─────────────┬─────────────┬─────────────┬─────────┤ │ │ │ │ │ │ │ Agent │ Tool │ Guardrail │ Context │ Runner │ │ Factory │ Registry │ System │ Management │ │ │ │ │ │ │ │ └─────────────┴─────────────┴─────────────┴─────────────┴─────────┘