# GitHub Agentic Workflows Study: The Prompt Injection Gap

> A close reading of the arXiv study of 1,248 gh-aw workflow files: how they are written, maintained, and why only 9.4% address prompt injection.

URL: https://www.matthewswong.com/en/blog/gh-aw-empirical-study-prompt-injection-gap/

- Author: Matthews Wong (https://www.matthewswong.com/en/about/)
- Published: 2026-10-17
- Updated: 2026-10-17
- Category: Security

> **Key takeaway:** A September 2026 arXiv study of 1,248 GitHub Agentic Workflow Markdown files from 276 repositories found that only 9.4 percent of 288 hand-labelled files address prompt-injection defense, while 97.6 percent state a task. Treat the instructions as security-relevant code: audit them alongside permissions, and enforce limits in frontmatter.

I went into this paper expecting a catalogue of clever prompts. What I got instead was a measurement of something I had not seen counted before: how ordinary people write the instructions that an AI agent follows inside their CI, and how little of that text says anything about distrust. The headline number is 9.4 percent. The rest of the paper explains why that figure is both alarming and easy to misread.

This post is a close reading of Khelifi, Oukhay, Ouni, Sayagh and Saied, Specifying and Maintaining Agentic Workflows, submitted to arXiv on 23 September 2026. I read the full text, then checked what the platform itself enforces against the official gh-aw documentation and OWASP guidance. Every number below comes from one of those pages. Where the paper is silent, I say so instead of filling the gap.

## How the authors built a corpus of 1,248 workflows

GitHub Agentic Workflows, or gh-aw, are Markdown files that pair natural-language instructions with frontmatter for triggers, permissions, engine, tools and safe outputs, and compile into GitHub Actions. To find them in the wild, the authors searched GitHub code search for the auto-generated header in YAML files under .github/workflows. Code search returns at most 1,000 results per query, so they split queries into non-overlapping file-size buckets and subdivided any bucket that still hit the cap.

Search for the generated header

4,533 YAML files, 1,528 repositories

Size bucketing works around the 1,000-result cap

Keep repositories with 10 or more stars

365 repositories, 1,435 YAML files

Filters out throwaway and test repositories

Map YAML back to Markdown, deduplicate

1,295 Markdown files, 281 repositories

Falls back to swapping .lock.yml for .md

Drop 29 empty bodies and 18 non-English files

1,248 files, 276 repositories

7,446 commits and 20,841 file-level changes, 31 July 2025 to 4 August 2026

Random sample for hand labelling

294 files sampled, 288 labelled

Sized with Cochran's formula; six files could not be labelled

Two details from this funnel change how you read everything after it. First, 108 of the 365 projects, 29.6 percent, referenced Markdown from another repository, so a meaningful share of these agents run instructions their owners did not write. Second, the coders labelled only the Markdown body, never the frontmatter or imports. Pre-resolution agreement between the two coders was 83.61 percent with a kappa of 0.61, and they settled the rest by discussion.

## What a typical workflow file looks like

The median workflow body is 104 lines and 556.5 words (mean 710), with a median of 9 headings, and 85.5 percent of headings are H2 or H3. Code blocks appear in 62.1 percent of files even though the median code block is only 5.5 lines. The files read hard: median Flesch Reading Ease is 38.8, though the authors caution that template syntax and symbols distort that score. Template expressions show up in 60.4 percent of files and pictographic symbols in 47.4 percent.

Below is the shape those numbers describe, written the way the reference documents each piece. It is a sketch assembled from the official snippets, not a file lifted from the dataset. Everything above the second divider is frontmatter, which the platform enforces. Everything below it is prose, which the model merely reads.

The paper describes frontmatter as covering triggers, permissions, engine choices, tool access and safe outputs, but reports no statistics on how often each setting appears. That is the first limit to hold in mind: we know how people write the body, and we do not know from this study how often they harden the header.

## Ten instruction categories and how often each appears

From the 288 labelled files the authors derived a taxonomy of 10 categories and 42 subcategories, labelled multi-label. Prevalence is the share of the 288 files that carry at least one instruction in that category. Almost everything an author writes is about what to do and what to produce; almost nothing is about what to refuse.

Task

97.6%

Evidence investigation 51.7%, artifact change 33.3%, artifact review 25.0%

Output

95.8%

Control signal 52.1%, new thread 41.7%, existing thread response 39.6%

Constraint

93.8%

Scope boundary 76.7%, quality standard 74.7%, resource budget 38.2%, evidence grounding 36.1%

Process

93.4%

Required sequence 88.2%, decision branch 87.2%, cross-run memory 18.1%

Resource

89.9%

GitHub interface 60.4%, local workspace 57.6%, web retrieval 14.2%

Context

84.7%

Repository context 70.1%, domain context 34.0%, historical context 8.3%

Evaluation

70.1%

Rule conformance 47.2%, risk assessment 29.9%, evidence credibility 11.1%

Example

68.1%

Output template 61.1%, technical snippet 30.2%, worked case 19.4%

Communication

63.9%

Role assignment 46.9%, automation disclosure 25.0%, audience voice 20.1%

Safety

25.0%

Execution isolation 13.9%, prompt injection defense 9.4%, confidentiality 7.3%, vulnerability handling 6.3%

Safety is the least common category of the ten, and prompt-injection defense sits inside it at 9.4 percent. The authors count an instruction as prompt-injection defense when it treats external content as data, rejects conflicting instructions, or limits which sources may direct the agent.

## The gap: 9.4 percent, and what it does and does not mean

Roughly 27 of the 288 labelled files, by my arithmetic on the reported 9.4 percent, tell the agent how to handle hostile input. The paper cites one positive example, an SDK-generation workflow that treats issue and comment text as untrusted. It reports no prompt-injection incidents, and it does not claim the other 91 percent were exploited.

The number still matters because of what these workflows read. Many of the Task labels are evidence investigation (51.7 percent), and the dominant resources are the GitHub interface (60.4 percent) and web retrieval (14.2 percent). OWASP describes indirect prompt injection as exactly this case: the model processes external content, such as web pages or files, that contains instructions which alter its behaviour. An agent that triages issues reads text written by strangers.

Two neighbouring numbers tell the same story. Resource budgets, meaning limits on time, retries, tokens, cost or files inspected, appear in 38.2 percent of files. Evidence credibility, which asks the agent to judge reliability, recency or cross-source agreement, appears in 11.1 percent. Authors ask agents for citations far more often than they ask them to doubt the citations.

> The 9.4 percent counts instructions in the Markdown body only. A workflow that restricts its network allowlist or caps its safe outputs in frontmatter is invisible to that figure. The gap is real in prose; it is not proof that 91 percent of these agents are unprotected.

## Workflows are maintained, so the gap compounds

For the evolution question the authors took 348 files from 43 repositories, each observed for at least 120 days. Of those, 78.2 percent still received updates in month 4. These are living documents that people keep editing, which is why a missing safety paragraph does not get fixed by default.

Across 8,575 analysed changes, 44.8 percent touched only frontmatter, 37.8 percent only the body, and 17.3 percent both.

The frontmatter-only share rose across months 1 to 4: 36.7, 29.9, 54.5 and 71.7 percent. The authors read this as people tuning schedules, permissions and tools rather than the agent's task.

Median project churn fell from 31.2 to 5.6 changed lines per 100 lines between months 1 and 2 (adjusted p = 0.011), then showed no significant change.

File size is a weak signal: about one third of content-changing events left the line count unchanged, so diffs, not wc, tell you whether instructions moved.

The practical reading is that the dangerous edits are the quiet ones. A change that widens a permission or adds a tool is frontmatter-only, shows up in 44.8 percent of changes, and is easy to approve in a review that skims the prose. The paper's first recommendation follows from this: treat cross-project Markdown sources as evolving dependencies, track upstream changes, pin or review the commit used for generation, and recompile only after checking changes to permissions, tools, cost, outputs and agent authority.

## Prose asks, frontmatter enforces

The paper's third recommendation is to separate enforceable rules from guidance: use frontmatter controls for firm limits, and body text for task-specific conditions. Its own example is a safe-output maximum of one matching a post-at-most-one-comment instruction. The gh-aw documentation shows what sits on the enforced side.

Distrust issue text

Markdown body

Advisory only. OWASP lists constraining model behaviour first but says there may be no foolproof prevention.

Agent is read-only

Job separation

The agent job has minimal read-only permissions; writes are buffered as artifacts and applied by later jobs.

Comment cap

safe-outputs add-comment max

max defaults to 1 for add-comment; max-links defaults to 50.

Egress limits

network allowed list

The Agent Workflow Firewall runs the agent in a container behind a Squid proxy with a domain allowlist.

Output screening

threat-detection

An AI pass checks for prompt injection, secret leaks and malicious patches before any safe output runs.

Sensitive files

Protected files layer

A separate rule-based layer guards dependency manifests, CI/CD config and agent instruction files.

Read that table as a division of labour. The first row is the only one the study measured, and it is the weakest. The other five are properties of the platform, and a workflow author gets them by configuring frontmatter rather than by writing a cleverer paragraph.

## Failure modes: where the controls and the study fall short

Threat detection is a control, not a guarantee. The reference page says detection only runs on the built-in engines, that it blocks safe outputs when any of prompt_injection, secret_leak or malicious_patch is true, and that if detection itself fails the safe outputs are not applied. It also documents false positives and timeouts on large patches as known failure modes.

The same page documents a continue-on-error option that defaults to true, under which detection warnings and failures produce a caution notice instead of blocking safe outputs, and a report-as-issue option that defaults to true. I could not reconcile from the page alone exactly when a true finding blocks versus warns, so I would set the option explicitly and test it on a throwaway repository rather than assume.

The study has its own limits, which the authors state. The evolution sample covers only 43 projects, so it describes maintained files, not all gh-aw workflows. Activity declined during the observation window, so maintenance was normalised against total repository commits. The LLM labelling experiment reached an F1 of 0.818 with Gemini 3.1 Pro Preview at one shot, but Gemini over-assigns labels, 15.86 per file against 14.62 in the reference, so automated scans of your own workflows will over-report. The paper also states that its taxonomy documents patterns but does not establish that budgets or defenses improve outcomes.

## What to do on Monday

None of this needs a new tool. It needs an inventory and a few lines of frontmatter. Do these in order, and stop at whichever step reveals something you did not expect.

1. List every gh-aw Markdown file and note which read issues, comments or web content. Those are the indirect-injection surface.
2. For each, check frontmatter for a safe-outputs max, a network allowlist and an explicit threat-detection setting. Missing ones are your fix list.
3. Add a short untrusted-input paragraph to the body, as defence in depth, and a resource budget sentence. Do not count it as the control.
4. If any workflow imports Markdown from another repository, pin the commit and review upstream diffs for permissions, tools and outputs before recompiling.
5. Make frontmatter changes reviewable on their own: require a code owner on the workflow directory, because 44.8 percent of changes touch only that part.

The audit script is deliberately crude. It greps, so it will miss paraphrases and flag false matches; treat its output as a worklist, not a verdict.

The rule I take from this paper: an agent instruction that tells the model to be careful is documentation, and only frontmatter is configuration. Write the careful paragraph, because the data shows almost nobody does, but put the real limits where the platform enforces them and review those lines with more suspicion than the prose.

## Sources

- arXiv: Specifying and Maintaining Agentic Workflows (abstract page)
- arXiv: the same paper, full HTML text
- GitHub gh-aw docs: architecture and security model
- GitHub gh-aw docs: safe outputs reference
- GitHub gh-aw docs: threat detection reference
- OWASP GenAI: LLM01 prompt injection

## Source links

- https://arxiv.org/abs/2609.27263
- https://arxiv.org/html/2609.27263
- https://github.github.com/gh-aw/introduction/architecture/
- https://github.github.com/gh-aw/reference/safe-outputs/
- https://github.github.com/gh-aw/reference/threat-detection/
- https://genai.owasp.org/llmrisk/llm01-prompt-injection/

## FAQ

### What did the empirical study of GitHub Agentic Workflows find?

The study analysed 1,248 gh-aw Markdown files from 276 repositories. Median instructions run 556.5 words, 62.1 percent contain code blocks, and 78.2 percent of files observed for at least 120 days still get updates in month 4. Only 9.4 percent of the 288 hand-labelled files address prompt-injection defense.

### Does the 9.4 percent mean most gh-aw workflows are vulnerable?

Not by itself. The coders labelled only the Markdown body, not the frontmatter, so network allowlists, safe-output limits and threat detection are not counted. The figure shows that few authors write distrust into their prose, and the paper reports no prompt-injection incidents.

### How do I protect a gh-aw workflow that reads issues and comments?

Put firm limits in frontmatter: a safe-outputs max, a network allowlist and an explicit threat-detection setting. The official docs describe a read-only agent job with writes applied by later jobs. Add a short untrusted-input paragraph to the body as a second layer, not the only one.

### What does gh-aw threat detection check for?

By default an AI analysis looks for prompt injection, secret leaks and malicious patches in the agent's buffered output before any safe output runs. It returns three boolean fields and a reasons array. The docs note it runs only on built-in engines and lists false positives and timeouts on large patches as known failure modes.

### Why does the study say to treat Markdown sources as dependencies?

Of 365 projects, 108 (29.6 percent) referenced Markdown from another repository. An upstream edit can change permissions, tools, cost or outputs without anyone rewriting the local file. The authors recommend pinning or reviewing the commit used for generation and recompiling only after checking those changes.

---

- HTML version: https://www.matthewswong.com/en/blog/gh-aw-empirical-study-prompt-injection-gap/
- Bahasa Indonesia: https://www.matthewswong.com/id/blog/gh-aw-empirical-study-prompt-injection-gap/
- Site index for agents: https://www.matthewswong.com/llms.txt
- Sitemap: https://www.matthewswong.com/sitemap.xml
- API description (OpenAPI): https://www.matthewswong.com/openapi.json
