How sudo-charan/guardgpt-majorproject works
GuardGPT is a local prompt-safety service whose canonical workflow accepts a prompt through the CLI/MCP client, runs layered input analysis and a safety decision, optionally generates and audits an answer, then returns a report. The README documents the complete pipeline and a separate LangGraph compatibility workflow; source excerpts verify the MCP entry point, adapters, and selected analysis behavior. Internal pipeline stages not excerpted are represented from the README, not inferred from inspected implementation. The listed tree omits the active dataset and FAISS index artifacts, so the loader is shown without a separate store node.
Main entry points: server.py MCP server · complete_pipeline.py Complete pipeline · safety_service.py Safety service · intent_classifier.py Intent classifier
Components 25
Request access
- CLI
main.py - MCP client
agent/mcp_client.py
Safety analysis
- Safety service
core/safety_service.py - Intent classifier
core/intent_classifier.py - Dataset evidence
core/dataset_loader.py - Risk estimator
core/risk_estimator.py - Jailbreak patterns
core/jailbreak_patterns.py - Conversation guard
core/conversation_guard.py - Temporal intent
core/temporal_intent.py
Decision and response
- Complete pipeline
core/complete_pipeline.py - Decision engine
core/decision_engine.py - Ollama backend
core/llama_backend.py - Output auditor
core/output_auditor.py - Audit and reports
mcp_server/tools/audit_logger.py
MCP interfaces
- MCP server
mcp_server/server.py - Tool schemas
mcp_server/models/schemas.py - Prompt analysis
mcp_server/tools/prompt_analysis.py - Jailbreak detection
mcp_server/tools/jailbreak_detection.py - Content moderation
mcp_server/tools/content_moderation.py - Decision adapter
mcp_server/tools/decision.py
Agent compatibility
- Server manager
agent/server_manager.py - LangGraph workflow
agent/graph.py - MCP agent nodes
agent/nodes.py
Other components
- User or app
- Ollama service
Connections 30
- User or app → CLI: submits prompt
README.md - CLI → MCP client: calls tool
main.py - MCP client → MCP server: invokes MCP
README.md - MCP server → Complete pipeline: runs request
mcp_server/server.py - Complete pipeline → Safety service: checks input
README.md - Safety service → Intent classifier: classifies intent
core/safety_service.py - Safety service → Dataset evidence: queries evidence
core/safety_service.py - Safety service → Risk estimator: estimates risk
core/safety_service.py - Safety service → Jailbreak patterns: checks patterns
core/safety_service.py - Complete pipeline → Conversation guard: tracks sessions
README.md - Conversation guard → Temporal intent: updates state
core/conversation_guard.py - Complete pipeline → Decision engine: decides action
README.md - Complete pipeline → Ollama backend: generates answer
README.md - Ollama backend → Ollama service: requests generation
README.md - Complete pipeline → Output auditor: reviews answer
README.md - Complete pipeline → Audit and reports: persists reports
README.md - MCP server → Tool schemas: validates inputs
mcp_server/server.py - MCP server → Prompt analysis: routes tool
mcp_server/server.py - MCP server → Jailbreak detection: routes tool
mcp_server/server.py - MCP server → Content moderation: routes tool
mcp_server/server.py - MCP server → Decision adapter: routes tool
mcp_server/server.py - Content moderation → Intent classifier: classifies prompt
mcp_server/tools/content_moderation.py - Content moderation → Dataset evidence: queries categories
mcp_server/tools/content_moderation.py - Jailbreak detection → Intent classifier: classifies prompt
mcp_server/tools/jailbreak_detection.py - Jailbreak detection → Jailbreak patterns: checks patterns
mcp_server/tools/jailbreak_detection.py - Prompt analysis → Intent classifier: classifies prompt
mcp_server/tools/prompt_analysis.py - Prompt analysis → Dataset evidence: queries evidence
mcp_server/tools/prompt_analysis.py - Server manager → MCP server: starts server
agent/server_manager.py - LangGraph workflow → MCP agent nodes: dispatches nodes
agent/graph.py - MCP agent nodes → MCP client: calls MCP tools
agent/nodes.py