Urgent.News

One page, thousands of outlets. See who else covered it.

Editions

Tech

Model-Generated GitHub Actions Need a Permission Gate

A model can write a valid GitHub Actions workflow that still leaks a secret. Lint the syntax, then gate the permissions. The failure mode Most checks on model-generated YAML stop at syntax. A workflow can parse cleanly, pass actionlint , and still: request id-token: write or contents: write read repository secrets in an unexpected step add a job that pushes to the default branch run on…

GitHub workflows can contain malicious code generated by AI models even if they parse correctly. Lint the syntax with tools like actionlint, then add a permission gate to prevent risky behaviors. The gate checks two things: first, the permissions section must have read access for the contents key. Then, no job should request write permissions or touch repository secrets.

Save the gate code as check_workflow.py, which uses Python's yaml module to parse the workflow file. It checks the permissions and job permissions, printing error messages and exiting if any violations occur. Run the gate after generating the YAML with a free AI model, saving the file, and running the checks on a free server. This lightweight gate catches the most common mistakes without complex analysis.

However, it cannot guarantee security, so only use it for low-risk workflows and always review the final code before merging.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

"I built a lying MCP server on purpose — here's how you catch it"

TL;DR — A server's README can say anything. Its tools/list response either backs that up or it doesn't. I built mcp-worse — a second binary, sharing two of mcp-better 's tool names, that deliberately…

  • Author created malicious MCP server named mcp-worse
  • Server intentionally violates protocol's claims
  • mcp-worse used to test contrast-smoke tool

More from Monday 17 August →