Getting Started with GitHub Agentic Workflows
https://www.kdnuggets.com/getting-started-with-github-agentic-workflows📌 【GitHub 新功能預覽】不再只是 Chat:Agentic Workflows 如何將 AI 轉化為自動化維運習慣
TL;DR:GitHub Agentic Workflows 透過 GitHub Actions 實現自動化 Agent,將 AI 從「對話工具」提升為「自動化流程」。
當週一早上九點,你的 Backlog 堆積了 43 個新 Issue,包含真正的 Bug、重複的 Feature Request,甚至只是有人在抱怨打字錯誤。傳統上,工程師得花兩小時進行分類、貼標籤並回覆,才能開始寫程式。GitHub 透過 Agentic Workflows 試圖解決這個問題。
🎣 從「手動任務」進化到「持續 AI (Continuous AI)」
GitHub 目前正將 Agentic Workflows 進行公開預覽 (Public Preview)。這與你平常在 Copilot Sidebar 進行的單次對話(Chat)完全不同,它更接近於一種「既定政策」:例如「每週一自動總結 Issue 活動」或「每次 PR 開啟時自動進行安全性審查」。
這正是 GitHub 所提出的「Continuous AI」概念——不是一次一個 Prompt,而是將 AI 系統性地應用於整個軟體生命週期,並將其編寫成可以定期執行或由事件觸發的自動化流程。
🧩 核心架構:以 Markdown 驅動的 Actions 流程
這項功能並非在你的 Repository 中掛載一個全新的 Agent 執行環境,而是直接複用現有的 GitHub Actions 架構。
- 撰寫指令:開發者在
.github/workflows/資料夾下撰寫一個 Markdown 檔案。 - YAML Frontmatter:檔案開頭包含一小段 YAML,用來描述觸發時機、權限範圍以及使用的 AI 引擎。
- 自然語言指令:在 YAML 之下,直接用英文描述你希望 Agent 執行的任務。
- 編譯執行:透過 CLI 工具
gh-aw將 Markdown 檔案編譯成標準的.lock.yml(即普通的 GitHub Actions workflow)。
目前預設支援四種 AI 引擎:GitHub Copilot、Anthropic Claude、OpenAI Codex 以及 Google Gemini,也支援自定義處理器 (Custom Processor)。
📊 技術規格一覽
| 指標 | 內容 |
|---|---|
| 支援 AI 引擎 | 4 種內建引擎 (Copilot, Claude, Codex, Gemini) + 自定義引擎 |
| 安全層級 | 5 層防護 (Read-only token, Zero secrets, Firewall, Safe outputs, Threat detection) |
| 支援事件觸發 | 10+ 種 (issues, pull_request, push, schedule, discussion, label 等) |
| 安全輸出類型 | 8+ 種 (create-issue, create-pull-request, add-comment, add-label 等) |
| 安裝方式 | gh extension install github/gh-aw |
⚠️ 安全性:解決「信任」與「指令注入」的關鍵
當 Agent 具備讀取內容的能力時,最大的風險在於「提示詞注入 (Prompt Injection)」——惡意使用者可能透過 Issue 或檔案內容來操縱 Agent。GitHub 並非假裝問題不存在,而是設計了五層防護機制:
- 唯讀權限 (Read-only tokens):Agent 預設僅具備讀取權限,無法直接推動程式碼或刪除檔案。
- 零機密資訊 (Zero secrets):執行 AI 模型的 Process 完全接觸不到 Write tokens 或 API Key,這些資訊只存在於隨後的檢查 Job 中。
- 網路防火牆 (Agent Workflow Firewall):Agent 在隔離的 Container 中執行,所有外連流量必須通過 Squid Proxy 的白名單。
- 安全輸出機制 (Safe outputs):這是最核心的設計。Agent 本身無法直接寫入 Repository,它只能產生一個「結構化請求」(例如:我想開一個標題為 X 的 Issue)。接著由一個具有狹窄寫入權限的「確定性 Job」來執行該請求。
- 威脅偵測 (Agentic threat detection):在輸出正式落地前,會由另一個 AI Job 進行掃描,檢查是否有注入攻擊或洩漏機密等異常模式。
🎯 實務啟示
對於工程師而言,這項技術的價值不在於「讓 AI 代替你寫 Code」,而在於「自動化瑣碎的維運工作」。例如:自動化依賴維護、漏洞修復、Issue 分類以及例行性的程式碼審查。這將開發者的精力從「處理重複性事務」轉向「建立可重複使用的 Agentic Workflows 範本」。
🔗 來源
- 標題:Getting Started with GitHub Agentic Workflows
- 作者/機構:Shittu Olumide @ KDnuggets
- 連結:https://www.kdnuggets.com/getting-started-with-github-agentic-workflows
#GitHub #AI #AgenticWorkflows #GitHubActions #DevOps #MachineLearning #SoftwareEngineering #GitHubCopilot #Automation #ContinuousAI
原始資料 KDnuggets · 收集於 2026-08-06
摘要原文
Getting Started with GitHub Agentic Workflows GitHub Agentic Workflows are in public preview. Find out all about them here. By Shittu Olumide , Technical Content Specialist on August 5, 2026 in Artificial Intelligence # Introducing GitHub's Agentic Workflows It's 9 AM on a Monday, and forty-three new issues are sitting in the backlog. Some are real bugs. Some are duplicate feature requests. A couple are just someone venting about a typo. Whoever is on triage duty this week is going to spend the first two hours of their day reading, labelling, and replying to all of them before they can touch anything they actually planned to build. That's the exact kind of work GitHub built Agentic Workflows to take off your plate. On June 11, 2026, GitHub moved Agentic Workflows into public preview , giving every repository the ability to run coding agents inside GitHub Actions to handle exactly this kind of reasoning-heavy, repetitive work. Not code completion. Not a chat sidebar. A scheduled or event-triggered agent that reads an issue, a pull request, or a week's worth of commits, and does something useful with what it finds. This article walks through what the feature actually is, why the security model matters more than the pitch-deck version of it, and how to write, compile, and run your first workflow today. By the end, you'll have a working triage workflow of your own and a clear sense of what's still a bit rough around the edges. # What Are GitHub Agentic Workflows? Strip away the marketing language, and the idea is fairly simple. You write a Markdown file that lives in .github/workflows/ . The top of that file has a small block of YAML frontmatter describing when the workflow runs, what it's allowed to touch, and which AI engine powers it. Below the frontmatter, you write plain-English instructions describing what you want the agent to do. A command-line interface (CLI) tool called gh-aw reads that Markdown file and compiles it into a .lock.yml file, which is a completely ordinary GitHub Actions workflow. That's the part worth sitting with for a second: there is no separate agent runtime bolted onto your repository. It reuses your existing runners, your existing branch protection rules, and your existing policy constraints, because underneath the natural language, it's just Actions . The project is built by GitHub Next and Microsoft Research , and it currently supports four AI engines out of the box: GitHub Copilot, Anthropic's Claude, OpenAI Codex, and Google Gemini, with the option to plug in a custom processor if none of those fit. Copilot is the default engine, and if your organization already pays for a Copilot plan, workflow runs can bill directly to that organization instead of requiring you to manage a separate API key. It also sits inside a bigger idea GitHub calls Continuous AI , which is really just the practice of applying AI systematically across the software lifecycle instead of one prompt at a time. Agentic Workflows is the mechanism for doing that on a schedule or in response to repository events, rather than only when a person happens to be sitting at their keyboard asking Copilot a question. It's also worth being clear about what this is not. It isn't the same thing as Copilot's cloud coding agent, which you kick off manually from an issue or a pull request when you want an agent to implement something specific for you right now. Agentic Workflows is closer to a standing policy: " every Monday, summarize the week's issue activity " or "every time a PR opens, review it for security concerns." One is a task you hand off. The other is a habit you build into the repository itself. # Why This Is Worth Paying Attention To GitHub doesn't typically publish adoption numbers this early in a preview, so the fact that they attached named customer quotes to the launch says something about how far along the internal testing already was. Carvana told GitHub the flexibility and built-in controls gave their engineering team enough confidence to run agentic workflows across genuinely complex systems, including changes that touch more than one repository at a time, according to the official changelog . Marks & Spencer described a similar story from a different angle: their developers were losing real sprint hours to the boring stuff — issue triage, dependency maintenance, vulnerability remediation, and routine review — and building a shared catalogue of reusable agentic workflows let teams pick up that automation across any repository without reinventing it each time. Hud.io made a point that's easy to miss if you're only skimming the feature list: getting an agent to open a pull request was never the hard part of this. Trusting the output enough to actually merge it is. That's really the whole thesis behind the security design covered in the next section. Here's the shape of the feature as it stands today, pulled directly from GitHub's own numbers page : Metric Value Supported AI engines 4 built-in (Copilot, Claude, Codex, Gemini), plus custom engine support Security layers 5 (read-only token, zero secrets, network firewall, safe outputs, threat detection) Documented design patterns 18+ (IssueOps, ChatOps, DailyOps, BatchOps, and more) Supported GitHub event triggers 10+ (issues, pull_request, push, schedule, discussion, label, and others) Safe output types 8+ (create-issue, create-pull-request, add-comment, add-label, and others) Installation One command: gh extension install github/gh-aw # The Security Model Is the Real Story Here Most " AI does your DevOps now " pitches skip straight past the obvious question: what happens when the agent gets it wrong, or worse, gets manipulated by something hostile sitting inside an issue comment or a file in the repo. Prompt injection through repository content is a known risk with any agent that reads untrusted text, and GitHub built five layers specifically to contain that, rather than pretend it can't happen. Read-only tokens: The agent's GitHub token is scoped to read-only access by default. If it tries to push code, open a PR, or delete a file directly, the token itself doesn't allow it, regardless of what the agent decides to attempt. Zero secrets in the agent process: The process actually running the AI model never receives write tokens, API keys, or credentials of any kind. Those live only in a separate job that runs after the agent has already finished and its proposed output has been checked. If the agent is compromised mid-run, there's nothing in its reach worth stealing. A sandboxed container behind a network firewall: The agent executes inside an isolated container, and all outbound traffic is routed through what GitHub calls the Agent Workflow Firewall , a Squid proxy enforcing an explicit allowlist of domains. Anything outside that allowlist gets dropped at the kernel level, so a compromised agent has no path to quietly phone home with your data. Safe outputs: This is the part worth understanding properly, because it's the mechanism that makes the rest of the model work in practice. The agent can't write to your repository directly at all. Instead, it produces a structured description of what it wants to do — something like "open an issue with this title and this body." A separate job with narrowly scoped write permissions reads that request and applies only what you've explicitly allowed in the workflow's frontmatter: a hard cap of one issue per run, a required title prefix, specific label restrictions, whatever you decide. The agent proposes. A gated, deterministic job disposes. Agentic threat detection: Before any of that output actually lands in your repo, a dedicated threat-detection job runs its own AI-powered scan across the proposed changes, checking for injection attempts, leaked credentials, or suspicious code patterns. If something looks wrong, the whole run fails, and nothing gets written.
由 tencent/hy3:free 自動生成