
GitHub Agentic Workflows turns natural-language instructions into a locked-down GitHub Actions workflow, with agents unable to write by default. The GitHub Next and Microsoft Research project applies AI judgment to CI/CD tasks while retaining controls from the Actions ecosystem. Better Stack demonstrates the approach with a code-complexity auditor that runs on a pull request. Learn how permissions, compilation and repository secrets fit into the setup, and what the auditor found when it encountered inefficient code.
Describe the Outcome Instead of Every Action
TL;DR Key Takeaways :
- Agents can analyze code by default, while writes require explicit approval through defined pathways.
- A compiler turns Markdown task instructions into a locked-down Actions workflow.
- The Big O Auditor flagged inefficient code in a pull request run lasting roughly 3 minutes.
- Other review and documentation tasks could suit agents, but final checks need human verification.
Traditional GitHub Actions follow deterministic rules: when a specified event happens, a predefined action follows. Some work needs more judgment, including bug triage, documentation updates and detecting architectural flaws. A fixed response may not be enough to handle those tasks.
Agentic Workflows uses what its creators call productive ambiguity. You describe the desired outcome in plain Markdown, leaving the agent to exercise judgment about how to achieve it. That lets an instruction focus on a goal, such as identifying inefficient code, rather than prescribing every response in advance.
Keep Agent Permissions Within Defined Boundaries
That discretion does not mean an agent can write freely to a repository. Agents run with minimal permissions by default: they can analyze code and suggest improvements, but write operations require explicit approval through predefined, sanitized pathways. The permission header in the workflow file is where you specify the agent’s permissions for its task.
The project takes an Actions-first approach, using the existing GitHub Actions ecosystem to run the workflow. Team-visible logs let a team see activity, while secrets management and auditable permissions provide controls around the agent’s work. The compiler turns the Markdown instructions into a locked-down Actions workflow.
Compile an Auditor From Markdown
The example uses GitHub Copilot as its AI provider and gives an agent a code-quality task. Its Big O Auditor checks commits for inefficient new code, suggests optimizations and presents its findings in a table. Follow these steps to set up and test that workflow:
- Add Agentic Workflows using the GitHub CLI extension.
- In the repository, create a GitHub folder and a workflows subfolder using the expected naming convention, so the compiler can find the Markdown files.
- Create agent.md in the workflows folder. Specify the agent’s permissions and AI provider in its header, then describe its task in natural language in the rest of the file.
- Choose GitHub Copilot as the provider and instruct the Big O Auditor to check commits, calculate the complexity of new code, identify inefficiencies and suggest optimizations. Ask it to present its findings in a Markdown-formatted table.
- From the repository root, run gh aw compile. The compiler converts the instructions into a locked-down GitHub Actions workflow stored in a lock YAML file; the example also produces an AW folder containing a GitHub Actions lock file.
- Set the chosen provider’s API key as a repository secret so the workflow can access it. The example uses a Copilot GitHub token.
- Push the changes to the repository to make the workflow ready for activation. The example is configured to run on new pull requests.
- To test the auditor, create a branch and add a function to main.py that searches for matching records with deliberately inefficient O(N²) complexity. Push the change and open a pull request.
The Auditor Finds an Inefficient Function
Opening the test pull request immediately activated the Agentic Workflow pipeline, which finished in roughly 3 minutes. The auditor identified the function as inefficient and explained why in the requested formatted table. It also proposed a better solution and calculated the potential performance impact of the optimization.
The result shows how an agent can apply judgment to a high-level goal of code quality and performance. Instead of needing a fixed response for the test function, the auditor examined the change and produced an explanation and a proposed improvement. The example adds a safety check around the codebase with minimal setup.
Other Tasks Could Use the Same Approach
The auditor’s instructions focus on complexity, but other outcome-focused tasks could also suit an agent. Possible uses include:
- An agent could review code for bugs and coding standards.
- It could update documentation based on code changes.
- It could analyze performance metrics and recommend optimizations.
Users may encounter latency when running agentic tasks, and a person should verify final checks rather than rely on the agent alone. The pull request test shows the time taken for that particular check, while its proposed optimization still calls for review before anyone acts on it.
We think the default permission boundary is a good reason to explore this approach carefully: the auditor can offer an analysis without unrestricted write access. The pull request result is useful, but a proposed optimization and its calculated impact are not a substitute for a human decision. Teams considering a similar check should weigh the time taken by a run and the review it needs against the value of the analysis they want to add.
Agentic Workflows remains a GitHub Next research prototype. It is part of the broader Continuous AI vision of agents autonomously monitoring and managing CI/CD pipelines, with the current workflow providing a way to explore an agent’s judgment within defined permission controls.
- Auto Claude Plans Coding Tasks and Syncs With GitHub
- New Notion 3 AI Agent Connects Google Tools, Runs Workflows & More
- How to use ChatGPT to create automated systems and workflows
Media Credit: Better Stack
Disclosure: Some of our articles include affiliate links. If you buy something through one of these links, Geeky Gadgets may earn an affiliate commission. Learn about our Disclosure Policy.