Skip to content

Gemini Code Assist Integration

Pisama exposes its detectors to Gemini Code Assist via the Pisama MCP server. Gemini Code Assist speaks MCP over stdio, so no new transport or auth surface is required.

Overview

From inside Gemini Code Assist you can:

  • List available detectors — filtered to the production tier by default.
  • Run a specific detector on a trace (e.g. loop, hallucination, injection).
  • Run full analysis with every detector in parallel.
  • Explain a failure type — get the detection methodology for each detector.

No API key, no backend, no network. The MCP server runs locally and uses pisama-core directly.

Installation

pip install pisama

Verify:

pisama mcp-server --help

Configure Gemini Code Assist

Add the Pisama MCP server to your Gemini Code Assist configuration. In VS Code or JetBrains with Gemini Code Assist installed, open the MCP servers panel and add:

{
  "mcpServers": {
    "pisama": {
      "command": "pisama",
      "args": ["mcp-server"]
    }
  }
}

Reload Gemini Code Assist. Confirm the server connected by prompting:

list pisama detectors

You should see the production-tier detector roster.

Available Tools

Tool Purpose
pisama_list_detectors List detectors. Optional tier filter (production / beta / experimental / all).
pisama_detect Run one named detector against a trace.
pisama_analyze Run the full detector suite.
pisama_status Session stats (analyses run, issues found, recent results).
pisama_explain Documentation for a failure type.

Example prompts

  • Discovery: "list pisama detectors" → returns production-tier detector names with tier, description, version.
  • Broaden: "list pisama detectors including beta" → tier: "beta".
  • Targeted run: "run the loop detector on this trace" (paste a trace JSON).
  • Full analysis: "analyze this trace with pisama" → runs all detectors in one call.
  • Learn: "explain the grounding failure type" → description + detection methodology.

Tier behavior

The tier parameter on pisama_list_detectors defaults to "production". Production detectors meet the F1 / regression gates defined in backend/app/detection_enterprise/calibrate.py::TIER_GATES. Beta detectors are still being calibrated and may emit false positives; pass tier: "beta" explicitly when you want them.

Troubleshooting

Gemini Code Assist doesn't see the server. Run pisama mcp-server in a terminal — if it starts, Gemini Code Assist can connect. If the command is missing, reinstall pisama.

"Unknown tool" errors. Verify you are on pisama >= 1.6.3; pisama_list_detectors was added in that release.

Empty detector list. Check the tier — tier: "production" filters aggressively. Try tier: "all" to confirm detectors loaded.