Skip to main content
When GitHub drafts are enabled for your organization, use these commands in any Guardian conversation. An investigation is optional. Everything after the command is an instruction for that request.
Type / in the composer to see the commands. Guardian continues the same conversation with its existing context. If the repository is unclear, it asks you to choose one; your reply continues the pending request. Pull request and issue drafts in a Guardian conversation

Review and create a pull request

Guardian checks out an authorized repository in a temporary workspace, edits the files, commits locally, and saves a CodeDiff. It does not push a branch or create a pull request. The command authorizes those local edits and commits; no command-approval card is needed to prepare the draft. You review the saved changes before publishing them to GitHub. Saved PR drafts also appear in Guardian → Code fixes, including drafts from standalone chats. Open a fix to inspect its diff and review or publish the PR, or follow its Chat source link to continue the conversation. Only people with access to the conversation can see its drafts. Revisions replace earlier unpublished versions in the list; published versions keep their PR links. A saved chat draft in Guardian Code fixes The Ready to create PR card opens a review dialog containing the saved changes. Review the diff, edit the title and description, and choose the new branch name. Click Create PR to publish with your permissions. The card then links to the pull request.
PR drafts are labeled Checks not run. This version does not run repository tests, builds, scripts, or dependency installation. Validate the generated changes through your normal development and CI process.
This version supports changes to regular text files, including additions, edits, deletions, and renames. Binary files, executable mode changes, symlinks, and submodules are rejected. If the target branch has moved since preparation, start a new /create-github-pr command asking Guardian to regenerate the changes against the current branch.

Review and create an issue

The Ready to create issue card shows the repository and proposed title. Open it to edit the title, description, and labels, then click Create issue. Guardian does not create the issue itself.

Revisions, retries, and history

Click Revise, describe what should change, and send the command. Guardian saves a new draft version. A PR revision recreates the checkout from the saved base and restores its patch. Each review publishes that exact version. Drafts and GitHub links survive reloading the conversation. Guardian receives the current artifact details, including publication results, on its next turn. If publication fails, the dialog shows the error. Retry with the original details so Metoro can check whether GitHub already created the artifact. To change details after an attempted publication, ask Guardian for a new version.

Access and availability

Your organization needs a GitHub integration with access to the repository. Reading and revising drafts follows the conversation’s access permissions, including when viewing a draft through a linked investigation. Publishing requires the existing investigations: create permission. Linking an investigation requires access to that investigation separately. This feature rolls out per organization using guardian.githubDrafts. PR preparation requires an isolated Docker or agent-sandbox Guardian runner. GitHub installation credentials stay on the Metoro server; Guardian receives fetch-only repository access and preparation tools, with no publication tool. Disabling guardian.githubDrafts hides chat drafts from both chat cards and Code fixes. Existing investigation fixes remain available. For self-hosted runners, use the updated Guardian runner image and sandbox template together. The runner operates as a non-root user with capabilities dropped. Its inner sandbox requires unprivileged Linux namespaces and confines file writes to the temporary workspace while blocking shell network access. Repository fetches go through the separate authenticated workspace helper. Hosts that block these namespaces cannot run PR preparation; ordinary chat remains available. Coding commands and diff capture can read only their checkout and required system files. Shells do not inherit authentication variables and cannot read sibling process environments or the runner’s authentication files. These restrictions apply when starting and resuming coding sessions.

Self-hosted configuration

PR preparation uses a fixed coding profile so local edits and commits stay authorized inside the isolated checkout. GUARDIAN_DEVELOPER_INSTRUCTIONS customizes ordinary chat and issue preparation; it does not override the PR preparation profile. The runner selects its local execution environment explicitly for each PR turn and refreshes the instructions for that turn. This allows an existing read-only chat to prepare a PR, then returns subsequent ordinary turns to their normal restrictions. To validate a runner image locally, run ./scripts/test-guardian-codex-sandbox.sh <runner-image>. The test uses the image’s pinned Codex app-server with a scripted model service, exercises file edits and local Git commits across saved sessions, and verifies that ordinary turns have no editing tools. It requires Docker and Go, but no model or GitHub credentials.