GitHub Integration Guide
Connect your AI agent to GitHub for repository management, issue tracking, code search, workflow triggers, and release management using a fine-grained Personal Access Token.
What your agent can do
Full GitHub capabilities through the REST and GraphQL APIs.
Repository management
Create branches, manage pull requests, and review code changes. Your agent can open PRs, leave review comments, and merge when approved.
Issue and PR creation
Create, update, and close issues and pull requests. Your agent can triage bug reports, assign labels, and track progress across repositories.
Code search
Search across your repositories for code, files, and commits. Your agent can find relevant code snippets, trace bugs, and answer questions about the codebase.
Workflow triggers and releases
Trigger GitHub Actions workflows, create releases, and manage tags. Your agent can kick off deployments and publish new versions.
Prerequisites
What you need before connecting GitHub to your agent.
- A GitHub account with access to the repositories your agent needs
- A fine-grained Personal Access Token with appropriate repository permissions
- A ClawTrust agent on any plan (Starter, Pro, or Enterprise)
Step-by-step setup
Connect GitHub to your agent in about 5 minutes.
Go to GitHub Settings > Developer settings
Log into GitHub, click your profile picture, and go to Settings > Developer settings > Personal access tokens > Fine-grained tokens.
Generate a fine-grained Personal Access Token
Click "Generate new token". Give it a descriptive name like "ClawTrust Agent". Set an expiration (recommended: 90 days). Select the specific repositories your agent needs access to, or choose "All repositories" if appropriate.
Configure repository permissions
Under Repository permissions, grant the access your agent needs. Common permissions: Contents (Read and write), Issues (Read and write), Pull requests (Read and write), Actions (Read and write for workflow triggers), Metadata (Read, required).
Copy the token
Click "Generate token" and copy the token value immediately. GitHub only shows the token once. It starts with github_pat_ for fine-grained tokens.
Add the credential in ClawTrust
In your agent's dashboard, go to Credentials > Add Credential. Select "API Key (Bearer)" as the type. Paste the token as the API key. Set allowed domains to *.github.com and api.github.com.
Test the connection
Click "Test" on the credential card. ClawTrust will verify the token against the GitHub API. Ask your agent to list your repositories to confirm access.
Credential details
Reference for the credential configuration fields.
Security note
Your Personal Access Token is encrypted with AES-256-GCM before storage. The credential proxy restricts all outbound requests to *.github.com and api.github.com. Use fine-grained tokens (not classic tokens) to limit access to specific repositories. Set a 90-day expiration and rotate before it expires. You can revoke the token from GitHub Settings at any time.
Example actions
Things you can ask your agent to do once GitHub is connected.
Create an issue in the frontend repo for the login page bug with steps to reproduce
Open a pull request that updates the README with the new API documentation
Search the codebase for all uses of the deprecated getUserById function
Trigger the deploy workflow on the main branch of the backend repo
List all open pull requests that need review and summarize the changes
Ready to connect your agent to GitHub?
Repository access in 5 minutes. Encrypted tokens, scoped permissions, full audit log.