Skip to content
Sozhan Natarajan
โ† Projects
Experiment Started Nov 2026

Agentic workflows on GitHub Actions

Practice with GitHub Agentic Workflows (gh-aw). Agents are defined in Markdown, compiled into locked GitHub Actions workflows, and can only write through sanitised "safe outputs".

Problem
Letting an AI agent act on a repository is useful, but handing it a write token is risky.
Outcome
A working hello-agent workflow. It reads issues with read-only permissions, finds the issue with the most ๐Ÿ‘ reactions and comments on it. Every write goes through declared safe outputs.
Stack
  • GitHub Agentic Workflows
  • GitHub Actions
  • Markdown

GitHub Agentic Workflows describe an agentโ€™s job in a Markdown file:

  • the frontmatter declares the triggers, token permissions and allowed write operations;
  • the body is the task, in plain English.

The gh aw CLI compiles the file into a regular, locked GitHub Actions workflow (.lock.yml).

The workflow

.github/workflows/hello-agent.md
---
name: Hello Agent
on:
workflow_dispatch:
permissions:
contents: read
issues: read # writes go through safe-outputs
safe-outputs:
create-issue:
add-comment:
target: "*"
---
## Task
Search the open issues in this repository.
Find the issue with the most ๐Ÿ‘ reactions.
Post a comment on that issue saying:
"This issue has the most community support! We'll prioritise it in our next planning session."
If there are no open issues, create one titled "Community Voting Test" and post the same comment.

Why the design matters

flowchart TB
  md["hello-agent.md<br/>(task + frontmatter)"] -->|gh aw compile| lock["hello-agent.lock.yml"]
  lock --> agent["Agent job<br/>read-only token"]
  agent -->|proposed outputs| safe["Safe-outputs step<br/>create-issue / add-comment only"]
  safe --> gh[(Repository issues)]

The agent itself only gets contents: read and issues: read. Anything it wants to change goes through safe-outputs, which allows only the operations listed in the frontmatter. This is least privilege for agents, the same principle as scoping CI tokens.