# From Your Laptop to the Pipeline: Scaling Custom Agents with GitHub Copilot

## Executive summary

This talk provides a comprehensive guide to scaling custom AI agents, moving them from local development environments to autonomous, enterprise-wide CI pipelines. Jose Palafox details the architecture of Copilot, covering the flow through the Copilot API service (the 'harness'). The process involves building agents locally, standardizing them via a marketplace, and finally deploying them into GitHub Actions using Agentic Workflows for cross-repository, automated maintenance tasks.

## Key takeaways

- Agent Modes: Local vs. Autonomous: Agents can operate in two modes: local agents (used for immediate, single-user tasks) and autonomous agents (running unattended in the CI pipeline or on the platform, utilizing repository identity and budget).
- Agent Development and Scaffolding: Custom agents can be generated using the agent builder, which scaffolds the necessary files (description, front matter, success criteria, methodology) from a simple prompt, allowing users to focus on the desired outcome rather than the structure.
- Scaling and Standardization via Marketplace: To scale adoption, agents should be shared through a marketplace (a specific repository structure). This enables centralized versioning, package management, and standardization across an organization.
- Cross-Repository Automation with Orchestrate: The `orchestrate` command allows agents to set goals across multiple repositories, enabling complex, cross-cutting changes (e.g., updating a microservice and its downstream dependencies) without needing to start the agent in every single repo.
- CI Integration with Agentic Workflows: Agents can be run in a headless mode using the Copilot CLI (`copilot cli -P`), making them suitable for GitHub Actions runners. This allows agents to perform maintenance tasks (e.g., code deduplication, documentation updates) on the repository's budget and identity.

## Technical details

- Copilot Architecture Flow: All interactions, regardless of the interface (IDE, GitHub CLI, SDK), pass through the Copilot API service (the 'harness'). This service handles complex infrastructure tasks like chunking input, managing authentication, preventing content repetition, and logging metrics/audits.
- Agent Invocation and Modeling: Embedded agents in the CLI can be invoked using the `/agents` command. Users can specify and control the underlying model (e.g., Haiku, Opus, GPT) for specialized tasks, such as using the 'Explorer agent' for codebase investigation.
- Agent Deployment and Sharing: Agents can be published either to a central marketplace or directly as assets within a dedicated organizational repository (e.g., `GitHub private`), ensuring standardization and reuse.
- Automated Workflows: Agentic Workflows utilize the Copilot CLI in a headless mode (`copilot cli -P`) within CI systems (like GitHub Actions). This enables automated, event-triggered processes (e.g., on release, or on a cron schedule) that run using the repository's identity.

## Practical implications

- By moving agent execution from local laptops to CI pipelines, organizations gain visibility into agent performance, cost, and tool call success rates, enabling critical optimization efforts.
- Implementing a centralized marketplace for agents ensures that teams solve common problems using standardized, reusable components, which is key for cost optimization and consistency.
- Using the repository identity for agents running in CI ensures that maintenance tasks are performed on behalf of the project, rather than relying on individual user credentials.
- The ability to use `orchestrate` allows build engineers to model complex, multi-repository changes as a single, coordinated agent goal.

## Topics

AI Agents, GitHub Actions, CI/CD Pipelines, Copilot CLI, Software Architecture, Agentic Workflows, GitHub Agentic Workflows, Copilot coding agent docs, GitHub Copilot

Source: https://www.youtube.com/watch?v=b9UhZkKjX_A
