TrueSource Agent is a knowledge control plane that sits between enterprise systems, documentation, and AI. It detects documentation drift, verifies claims against live operational evidence, proposes governed repairs, and exposes only verified knowledge to downstream assistants and RAG.
Its AgentFirewall also protects the agent itself: malicious instructions hidden inside documents or tickets are detected and quarantined before they can influence a model or trigger a tool.
Traditional enterprise RAG often treats stale documentation as truth. When Payments has moved from EC2 to EKS but the docs still say EC2, retrieval makes the wrong answer easier to produce, not harder.
TrueSource turns that into a governed, agent-safe workflow:
Enterprise systems → AgentFirewall → Verified truth → Documentation → Trusted AI
The product collects evidence, blocks unsafe instructions, explains contradictions, proposes fixes, requires human approval, updates stale documents, and refreshes the verified knowledge layer.
- Detect drift between Confluence or SharePoint and AWS, GitLab, Jira, and ServiceNow.
- Calculate deterministic, authority-weighted confidence before asking a model for an explanation.
- Generate document repair proposals with evidence and provenance.
- Require reviewer approval before executing connector writes.
- Answer questions from verified facts instead of stale documents.
- Block prompt injection, knowledge manipulation, credential requests, concealment, and destructive instructions.
- Investigate suspicious edits using author, version, change-request, and operational context.
- Preserve an audit trail of scans, decisions, containment, and approvals.
The current repo contains:
backend/FastAPI control plane for scans, incidents, approvals, audit, and verified answers.frontend/Next.js dashboard with demo controls, evidence review, trust card, and agent activity.mocks/separate FastAPI services for AWS, GitLab, Jira, ServiceNow, Confluence, and SharePoint.trigger/Trigger.dev schedule definition plus a lightweight worker container entrypoint.cloudrun/Cloud Run manifests..kiro/specs/truesource/requirements, design, and task specs.
Runtime behavior highlights:
- Scans are deterministic-first: connector evidence and scoring establish drift before any model narrative.
- External model egress is redacted and provider-routed (OpenAI, OpenRouter, or deterministic fallback).
- Control-plane state is persisted in PostgreSQL and reloaded on backend startup.
- Approval decisions are reviewer-gated and recorded in audit history.
- AgentFirewall makes deterministic
ALLOW,REVIEW, orBLOCKdecisions before model access and validates document writes before connector execution.
- OpenAI for explanation and answer synthesis.
- OpenRouter as a provider fallback path.
- CopilotKit-oriented UX structure in the web app.
- Exa reserved for supplementary public verification.
- Trigger.dev for scheduled scans.
- Ambiguous AI represented through adapter-first design.
- Mozilla-style privacy boundary through redaction and provenance.
- Google Cloud Run deployment manifests for web and API.
cp .env.example .envOptional keys:
OPENAI_API_KEY=
OPENROUTER_API_KEY=
EXA_API_KEY=
NEXT_PUBLIC_COPILOTKIT_RUNTIME_URL=
NEXT_PUBLIC_COPILOTKIT_AGENT_ID=truesource_guardianNotes:
- Development auth mode is always enabled and reviewer actions use the demo actor path.
- OpenRouter is supported through the same model gateway and can be selected at runtime from the dashboard when configured.
- CopilotKit is wired into the app shell and will activate its sidebar when
NEXT_PUBLIC_COPILOTKIT_RUNTIME_URLis set.
docker compose up --buildUseful lifecycle commands:
docker compose ps
docker compose logs -f backend frontend
docker compose down
docker compose up --build -dExpected services:
postgresmock-awsmock-gitlabmock-jiramock-servicenowmock-confluencemock-sharepointbackendfrontendworker
Open:
- Frontend:
http://localhost:3000 - Backend docs:
http://localhost:8000/docs - API health:
http://localhost:8000/api/health
- Open the dashboard and ask “How is Payments deployed?” to see the stale EC2 answer.
- Click
Simulate Migration → EKS. - Click
Run Scan. - Review the knowledge incident, evidence, and proposed diffs.
- Click
Approve & refresh verified RAG. - Ask the same question again and verify the answer now says EKS with confidence and provenance.
- Click
Reset Demoto restore the original scenario.
Additional operational scenarios are available for database modernization, region failover, and GitOps rollout.
- Click
Reset Demo, thenSimulate Migration -> EKS. - Click
Simulate malicious Confluence editto add a hidden instruction that tries to keep stale EC2 knowledge verified despite contradictory AWS and GitLab evidence. - Click
Run Scan. - AgentFirewall changes from
EDIT PENDING SCANtoTHREAT CONTAINEDand shows four concise reasons: external author, unexpected version, no linked change request, and live-system evidence. - Confirm TrueSource still detects the legitimate EC2 -> EKS drift from trusted evidence.
- Approve the safe repair; AgentFirewall validates the write before the connector executes.
The incident panel keeps the default explanation simple. Select Show technical details to inspect the detection signals and containment trace.
| Decision | Meaning | Result |
|---|---|---|
ALLOW |
Content is low risk | Admit it to the evidence pipeline |
REVIEW |
Content is ambiguous | Retain it for human review |
BLOCK |
Content contains a dangerous instruction | Quarantine it, deny sensitive tools, and continue with trusted evidence |
AgentFirewall enforcement is deterministic and does not require a model key. OpenAI or OpenRouter may generate explanations, but the model does not decide whether a dangerous action executes.
See docs/agent-firewall-testing.md for detailed tests and expected results.
- Open
http://localhost:3000/portalfor a Confluence-style documentation workspace. - Browse and search pages from the mock Confluence source.
- Inspect SharePoint mirror content and version metadata side by side.
- Pitch deck script and judge talk track:
docs/hackathon-pitch.md - Submission-ready descriptions (short, medium, long):
docs/project-description.md
Core endpoints:
GET /api/healthGET /api/dashboardGET /api/documentsGET /api/knowledgeGET /api/driftGET /api/drift/{id}GET /api/drift/{id}/evidenceGET /api/scans/{id}POST /api/scanPOST /api/drift/{id}/approvePOST /api/drift/{id}/rejectGET /api/demo/scenariosPOST /api/demo/changePOST /api/demo/inject-agent-attackPOST /api/demo/resetGET /api/docs/portalPUT /api/docs/portal/confluence/{id}PUT /api/docs/portal/sharepoint/{id}POST /api/askGET /api/auditGET /api/firewall/incidentsGET /api/runtimeGET /api/auth/me
Run all backend tests:
python3 -m venv .venv
source .venv/bin/activate
pip install -r backend/requirements.txt
python3 -m pytest backend/testsThe suite covers scan and approval behavior, security redaction, prompt-injection quarantine, contextual investigation, write authorization, and protection of model input.
For the complete AgentFirewall test flow and expected UI results, see docs/agent-firewall-testing.md.
Deployables:
truesource-apitruesource-web- optional worker runtime depending on Trigger.dev setup
See the docs set for architecture, API, deployment, security, and sponsor integration details.
Current controls include:
- Reviewer-only approval and rejection operations.
- Redaction before outbound model-provider calls.
- Development-mode actor identity via local headers.
- Persisted audit trail for scan and decision events.
- Ingress inspection across Confluence, SharePoint, GitLab, Jira, and ServiceNow.
- Quarantine before malicious content reaches a model.
- Pre-execution checks for reviewer identity, tenant, diff, and connector target.
- Contextual investigation of source ownership, version history, change records, and live evidence.
Remaining hardening roadmap includes tenant isolation and production secret-management posture.
Recent validation includes:
- Full Docker Compose startup and health verification for frontend, backend, postgres, worker, and mock services.
- Frontend runtime check returning HTTP 200 after conditional Auth0 integration fixes.
- Backend tests passing via
pytest backend/tests.
- Expand integration and E2E test coverage across connector and UI workflows.
- Add migration-managed relational schema evolution and stronger operational observability.
- Complete production auth hardening (tenant isolation and policy controls).
- Deepen CopilotKit runtime behaviors and assisted review workflows.
- Replace mock connectors with live enterprise adapters using the same normalized interfaces.