Use Guru to explain risky AI-generated changes and support human release decisions.
Guru is Guardian's built-in assistant for AI-generated code control before release. It explains risky changes, suggests fixes, and supports human approval and override workflows.
| Feature | Description |
|---|---|
| Risk Explanations | Explains why a change is risky for release |
| Policy-Aware Guidance | Aligns suggestions with architecture/security/quality policy |
| Fix Suggestions | Provides actionable code changes |
| Human Approval Context | Produces rationale approvers can use in release decisions |
Guru is not a generic coding copilot. Use it in this order:
The Guru chat panel is accessible from the main interface. Simply type your question in the chat input at the bottom of the screen.
Guru understands natural language queries:
"Why is this function flagged as a security issue?"
"How can I fix the N+1 query problem here?"
"What's the best way to refactor this class?"
"Explain the architectural impact of this change"
Guardian can use Tavily to pull up-to-date information from the web. Web search is opt-in and requires a Tavily API key.
Enable it in Settings > Web Search. You can also force web search for a single message by adding /web or @web:
"/web What are the latest React best practices?"
"Explain the latest TypeScript 5 features @web"
You can control depth in Settings > Web Search:
site:example.com to restrict sources when you already know the best domain.When Guru suggests a fix, prefer receiving the FULL updated file content (no diff markers and no markdown). Then:
.guardian-proposals/fix_proposals.jsonl and use Reviews to apply and track it.Tip: Always review fixes before applying. Guru is helpful but suggestions should be verified.
Guru can analyze code for:
Ask Guru to explain:
Guru can suggest:
Navigate to Settings to configure Guru:
| Setting | Description |
|---|---|
| Provider | AI model provider (Ollama, OpenAI, etc.) |
| Model | Specific model version |
| API Key | Your provider API key |
In Settings, you can configure Tavily for web search:
| Setting | Description |
|---|---|
| Tavily API Key | Enable web search capabilities |
Guru maintains conversation history per project:
Good prompts are specific:
"Explain why the useEffect in UserProfile.tsx causes a memory leak"
Avoid vague prompts:
"What's wrong with my code?"
Guru explanations are educational:
Guardian includes semantic search to find similar code patterns across your codebase:
When you scan your project, Guardian creates semantic embeddings of findings and stores them locally. This enables similarity-based retrieval.
Trigger semantic search by using these keywords in your query:
"Find similar issues to this"
"Show me critical patterns like this"
"Are there semantic matches for this vulnerability?"
Guru automatically uses semantic search when you include:
When semantic matches are found, Guru includes them in the context:
### Semantic Similarity Matches
- `src/auth.ts` [Critical] similarity=0.87 (openai:text-embedding-3-small)
- preview: SQL injection in user input validation
- `src/db.rs` [Critical] similarity=0.82 (openai:text-embedding-3-small)
- preview: Raw SQL concatenation with user input
Guardian supports multiple embedding strategies:
| Provider | Model | Use Case |
|---|---|---|
| Auto (default) | openai:text-embedding-3-small or ollama:nomic-embed-text | Uses OpenAI when a valid key exists; otherwise starts with Ollama and falls back to local hash |
| OpenAI | text-embedding-3-small | Best quality, requires API key |
| Ollama | nomic-embed-text | Local/offline option |
| Local Hash | Deterministic fallback | Offline mode, no external calls |
Configure via environment variables:
GUARDIAN_EMBED_MODE=ollama # or "openai", "local", "auto"
GUARDIAN_EMBED_PROVIDER=openai # legacy alias
GUARDIAN_EMBED_MODEL=text-embedding-3-small
GUARDIAN_EMBED_MODEL_OLLAMA=nomic-embed-text
GUARDIAN_OFFLINE=1 # Forces local hash fallback
~/.guardian/memory.dbGuru is powerful but has limits:
| Limitation | Workaround |
|---|---|
| Large files may be truncated | Focus on specific sections |
| May not know proprietary patterns | Provide context in prompts |
| Suggestions need review | Always verify before applying |
| Rate limits apply | Configure provider limits |
| Semantic search requires prior scans | Run a scan first to build the index |
When using Guru:
| Issue | Solution |
|---|---|
| No response | Check API key in Settings |
| Generic answers | Include more context in your question |
| Slow responses | Try a faster model |
| Incorrect suggestions | Provide more specific context |