Codebase best practices
Connecting your codebase gives AI agents the ability to search and understand your app's code. This means more accurate support responses, better documentation, and smarter development assistance. It's one of the most powerful things you can do in Mantle — here's how to get the most out of it.
How your codebase is used
Once connected, your codebase context is available across several parts of Mantle:
| Feature | How codebase is used |
|---|---|
| AI Agents | Agents with codebase access can search your code to answer technical questions, debug issues, and provide development guidance. |
| Support | When agents are used in the help desk, they can reference your codebase to generate more accurate customer-facing responses about how your app works. |
| Documentation | AI can use your codebase to help generate and improve documentation, referencing real feature names, functions, and behavior. |
| Flows | Automated workflows can leverage codebase context for analysis and content generation. |
Things to keep in mind
AI is powerful but not perfect — it can misinterpret code, reference outdated logic, or fill in gaps with incorrect assumptions. This is true of all AI systems.
Mantle is not responsible for the accuracy of AI-generated content that uses your codebase. If you choose to use codebase-powered agents for customer-facing responses, that's entirely your call. We just recommend reviewing the output, especially when it's going directly to customers. This applies to:
- Support responses generated by AI agents
- Documentation created or updated with AI assistance
- Flow outputs that reference your codebase
- Any other customer-facing content where AI has used your code as context
Best practices
Consider a tiered support setup
A common approach is to separate your support into tiers. Use a general AI agent without codebase access for routine questions (Tier 1) — this agent can respond to customers automatically using your docs and knowledge base. Then use a codebase-enabled agent for technical investigations and bug reports (Tier 2), where your team reviews responses before they go out. See Recommended setup for codebase-enabled support for how to set this up.
Keep your codebase current
If your code changes significantly, update your codebase connection so agents are working with accurate information. Outdated code leads to outdated answers.
Be mindful of what you include
Mantle automatically excludes common sensitive files (like .env files) during indexing, and AI agents are designed not to expose raw code, API keys, or credentials in their responses. Still, it's good practice to be thoughtful about what you upload — avoid including files with hardcoded secrets or sensitive configuration.
Test before going live
Before enabling codebase-powered agents in production support flows, try them out yourself. Ask the kinds of questions your customers would ask and check that the responses are accurate and helpful.
Grant access selectively
You can control which agents have access to your codebase. Not every agent needs code context — enable it where it adds real value, like technical support or development assistance.
What Mantle does with your code
- Secure indexing — Your code is indexed and stored in isolated, encrypted storage. Each organization's codebase is completely separate.
- AI-only usage — Your code is used solely for AI search and context. It's not displayed, shared, or used for any other purpose.
- Organization isolation — Your code is never shared with or accessible to other organizations.
- Full control — You can disconnect or delete your codebase at any time. Deleting removes all indexed files and metadata.