Repository navigation
feat: expose auth's roles as GitHub Copilot custom agents - #3
Merged
aditeyabaral merged 4 commits intoSep 26, 2026
Merged
Conversation
Copilot lists custom agents only from real .github/agents/<name>.agent.md files on a repo's default branch, and GitHub does not read files through a submodule, so the roles here were invisible to it. Projects now keep generated wrappers there (frontmatter copied from the role, body pointing at the role file), which leaves the role file as the only definition. The generator and its drift check live in the project repo, so this repo still has nothing generated in it. The four read-only roles gain a `tools` list in Copilot's aliases, so their custom agents get no edit tools. Other tools ignore the field. The README, auth's AGENTS.md, autonomous-workflow, ci-cd and fix-ci describe the wrappers, the sync-agents check and copilot-setup-steps.yml, which land in pesu-dev/auth with the submodule bump. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The first commit updated the entry points; these are the reference docs that also describe files, hooks and workflows the change touches: architecture's file table, the mdformat frontmatter plugin in conventions, the sync-agents hook in testing, copilot-setup-steps.yml among the places that pin the Python version, a navigate-codebase row, and that TEST_* secrets never reach Copilot's cloud agent. common/AGENTS.md extends "do not edit" to files a project generates from this repo. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Three things the earlier commits got wrong or left out: - A Dependabot bump that changes a role's frontmatter fails sync-agents, and the docs said to fix it "on the same PR". That branch lives in pesu-dev/auth, where agents and contributors cannot push. ci-cd.md now has the procedure (a maintainer pushes to it, or anyone supersedes it from a fork), fix-ci and the README point at it, and the README tells skills contributors when to expect it. - Copilot's cloud agent opens its pull request from a branch in the repo it runs in, which the origin policy rejects in pesu-dev/auth. autonomous-workflow now says to run it on a fork, and that its default firewall blocks PESU Academy, so its test runs are partial. AGENTS.md points there. - The README's "default branch" claim applies to GitHub.com only, and the cloud agent's secrets come from the `copilot` environment, not the workflow. security-review gains a check that agents gain neither secrets nor edit tools. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
pesu-auth logs the scraped profile and the auth result at INFO so a login can be traced to what PESU Academy returned. That is a design choice, but security.md, conventions.md, the security-review checklist and known-issues.md all called it a defect, which invites agents to "fix" it. They now describe it as deliberate, and AGENTS.md's logging rule says so. The CSRF token entry stays in known-issues. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
21 of 22 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
GitHub Copilot, on GitHub.com and in VS Code, lists custom agents only from real
.github/agents/<name>.agent.mdfiles on a repo's default branch. GitHub does not read filesthrough a submodule, so auth's ten roles in this repo never show up in Copilot's agent picker.
What
.github/agents/becomes the one tool-specific path in project repos (README: "Roles asCopilot custom agents"). A project keeps a thin wrapper per role there: the role's frontmatter,
copied verbatim, and a short body telling the agent to read the role file here, which stays the
only definition. The wrappers are generated and drift-checked in the project repo, so this
repo still has no scripts and nothing generated.
toolson the four read-only roles (planner, reviewer, security-auditor,incident-investigator):
["read", "search", "execute", "github/*"], using Copilot's aliases.Their custom agents get no edit tools; the shell stays, because they run tests,
git diffandcurl /metrics. The README says plainly that this is not a sandbox. Other tools ignore the field.auth docs: AGENTS.md (the "never edit" rule, the repo map and the roles section),
autonomous-workflow ("Using roles"), ci-cd (the pre-commit row, and a new
copilot-setup-steps.ymlrow), and fix-ci (a row for a failing
sync-agentscheck, which is what a Dependabot bump thatchanges a role will hit).
The fork-only policy, applied to the new moving parts:
sync-agents, and nobody but amaintainer can push to Dependabot's branch.
ci-cd.md("Dependabot submodule bumps") givesboth routes (a maintainer pushes the regenerated agents, or anyone supersedes the PR from a
fork).
fix-ciand the README point at it, and the README tells skills contributors when toexpect it.
source.yamlrejects in pesu-dev/auth.
autonomous-workflow.mdsays to run it on a fork, and that itsdefault firewall blocks PESU Academy, so its test runs are partial.
AGENTS.mdpoints there.Reference docs: architecture, conventions (
mdformat-frontmatter), testing, security (noTEST_*in thecopilotenvironment, plus a security-review check for it), update-dependencies(
copilot-setup-steps.ymlpins Python too), navigate-codebase, andcommon/AGENTS.md(generated files are not hand-edited either).
Profile logging is deliberate: pesu-auth logs the scraped profile and the auth result at INFO
so a login can be traced. security.md, conventions.md, the security-review checklist and
known-issues.md called that a defect; they now describe it as a design choice, and AGENTS.md's
logging rule says so. The CSRF-token entry stays in known-issues.
Follow-up
The pesu-dev/auth side is ready locally:
scripts/sync_agents.pywith tests, the ten wrappers, thesync-agentshook,submodules: trueon the pre-commit checkout, andcopilot-setup-steps.yml. Itwas verified against this branch: pre-commit is green, including the full test suite with live
tests, and editing a role's description makes
--checkfail. I'll open it once this merges, pinnedto the merge commit.
Checks
uvx pre-commit run --all-filespasses locally, and mdformat keeps the newtoolslines intact.🤖 Generated with Claude Code