Class GitHubTools

java.lang.Object
com.example.github.GitHubTools

public final class GitHubTools extends Object
Reusable GitHub function tools backed by the org.kohsuke:github-api client. Each returns a Map with a "status" of "success" or "error". Reads GITHUB_TOKEN from the environment; callers set dryRun to gate writes.

Defense in depth against prompt injection: the agent reads untrusted GitHub content (diffs, file contents, issue/PR titles) and could be steered into harmful writes. Independently of the prompt, the write tools (a) only target writeRepoOwner/writeRepoName when set, (b) only modify Markdown files under docs/, and (c) are capped per run.