Documentation
Code Integration
Connect your GitHub repository and fix agent issues directly in your codebase. Chat with AI, get suggestions, see diffs, and create PRs.
The Problem
Traditional observability tools show you *what* went wrong, but leave you to figure out *how* to fix it. You end up context-switching between dashboards, code editors, and AI assistants — copying error messages, searching for relevant code, and manually piecing together solutions.
The Solution
Guardy's Code Integration connects the dots. When you find an issue, you can:
- See the issue with full context (session data, events, diagnosis)
- Chat with AI that knows both the issue AND your codebase
- Get code suggestions with real diffs
- Create a PR with one click
How It Works
Link your GitHub repo in Settings. Guardy indexes your codebase.
Choose which files/folders are relevant to your agent code.
Discuss issues with context. Ask questions, get explanations.
Accept suggestions and create a pull request automatically.
Setting Up Code Integration
Go to Codebase in the sidebar, then click Add Repository. Authenticate with GitHub and select the repositories you want to connect.
Guardy will index your repository. This usually takes 1–5 minutes depending on size.
Use the file tree to select folders containing your agent code. This helps the AI focus on relevant files when generating suggestions.
Pro tip: Select your agent directory, tools, and any prompt files.
You're ready! When you find an issue, click "Fix in Code" to open the code integration view with context pre-loaded. Or open the Codebase page directly to chat.
Using the AI Chat
The AI chat is context-aware — it knows about:
The selected files from your repository.
Session data, events, and diagnosis.
Common patterns for agent development.
Example Prompts
- "Why is the search\_kb tool returning empty results?"
- "How can I add a fallback when the API times out?"
- "The agent keeps asking clarifying questions instead of acting. How do I fix the prompt?"
- "Add error handling to the create\_ticket tool"
- "Optimize this function to reduce token usage"
Creating Pull Requests
When the AI suggests code changes, you'll see a diff view showing exactly what will change. If you're happy with the changes:
You can ask for modifications if needed.
Click "Apply Changes" to stage the changes.
Click "Create PR" to open a pull request on GitHub.
Review and merge the PR in GitHub as usual.
Security & Privacy
OAuth Authentication
We use GitHub OAuth — we never store your GitHub password.
Minimal Permissions
We only request the permissions needed to read code and create PRs.
No Storage
Your code is processed in real-time and not stored on our servers.
You Control Access
Revoke access anytime from your GitHub settings.