← Back to News

From one-off prompts to workflows: How to use custom agents in GitHub Copilot CLI

GitHub Copilot CLI has evolved beyond answering random terminal questions. The latest addition—custom agents—lets you teach Copilot about your specific tech stack, infrastructure patterns, and team processes. Instead of explaining your deployment pipeline every time you ask for help, you can set it up once and have Copilot understand your context automatically. This shift from one-off prompts to repeatable workflows is particularly valuable for teams managing complex cloud environments or standardized deployment procedures.

Custom agents work by accepting context files and instructions that describe your architecture, tools, and conventions. When you interact with Copilot CLI, these agents provide background information that shapes how the AI responds to your questions. Think of it like uploading documentation about your specific setup—whether that’s your AWS infrastructure patterns, Terraform modules, or internal deployment scripts. Technically, you’re creating agent definitions that Copilot references when processing natural language commands, allowing it to generate suggestions that account for your actual environment rather than generic best practices. This means when you ask “how do I deploy this service?”, Copilot knows your team uses Lambda, API Gateway, and RDS—and can suggest solutions that fit that reality.

The practical benefits become clear once you consider common scenarios. A DevOps team managing multiple microservices can create an agent that understands their CI/CD pipeline, naming conventions, and infrastructure-as-code standards. When a developer asks Copilot to set up monitoring for a new service, the agent ensures recommendations follow your monitoring patterns and use your existing tools. Similarly, data teams working with dbt, Apache Airflow, and S3 can define an agent that understands their data pipeline conventions, so Copilot suggests transformations and queries that integrate cleanly with existing workflows. Even smaller teams benefit—defining your standard Linux toolset, Python linting rules, or API authentication patterns once means Copilot stops suggesting incompatible approaches.

Custom agents also reduce friction in knowledge transfer. When onboarding engineers or working across teams, having Copilot encode your workflows directly means new team members get better guidance faster. Rather than reading scattered documentation, they can ask Copilot questions and receive suggestions aligned with your actual practices. For teams using AWS, this might mean defining agents that know your preferred services, security patterns, and cost optimization rules—so Copilot steers folks toward solutions that match your standards. If you’re already using GitHub Copilot and managing infrastructure through code, custom agents represent the natural next step: bringing your domain knowledge directly into your AI assistant.

Source
↗ The GitHub Blog