Skip to main content

Threat Model (Initial) -- AI Support Copilot

Engagement: AI Support Copilot Pilot Owner: Shubham (Governance Engineer) Version: 1.0 Date: 2026-05-01 Framework ref: Doc 14 (Enterprise Security Framework) Non-negotiable: Yes -- Doc 01, Section 5.1, Item 1 (Threat modeling and secrets management)

This is the initial threat model produced during Discovery. It identifies the threat surface and top threats. A full threat model with validated mitigations is due by Sprint 1 demo (May 10). The threat model is a living document updated as the system evolves.


1. System Scope

Components in Scope

ComponentTechnologyTrust Level
FrontendReact (browser)Untrusted (client-side)
Backend APIExpress (Node.js)Trusted (server-side)
Pipeline OrchestratorLangChain.jsTrusted (server-side)
LLM GatewayCustom abstraction layerTrusted (server-side)
Operational DBMongoDBTrusted (data store)
Search IndexElasticsearchTrusted (data store)
LLM ServiceVertex AI (Gemini)External trusted (Google-managed)
Embedding ServiceVertex AI text-embedding-005External trusted (Google-managed)

Components Out of Scope (Pilot)

  • Freshdesk API integration (not built in pilot)
  • Production infrastructure / load balancing
  • Customer-facing endpoints (agent-facing only)
  • Network-level security (firewall, VPN) -- deferred to production

2. Data Flow Diagram

┌──────────────────────────────────────────────────────────────────┐
│ TRUST BOUNDARY: Browser │
│ │
│ ┌──────────┐ │
│ │ React │ ──── (1) HTTP/REST ────┐ │
│ │ Frontend │ ◄── (8) JSON response ─┤ │
│ └──────────┘ │ │
└──────────────────────────────────────┼──────────────────────────┘

┌──────────────────────────────────────┼──────────────────────────┐
│ TRUST BOUNDARY: Server (GCP VM) │
│ ▼ │
│ ┌──────────────────────────────────────┐ │
│ │ Express API Server │ │
│ │ (2) Validate + route request │ │
│ └──────────┬───────────────────────────┘ │
│ │ │
│ ▼ │
│ ┌──────────────────────────────────────┐ │
│ │ LangChain.js Pipeline │ │
│ │ (3) Classify ─► (4) Retrieve │ │
│ │ (5) Reason ──► (6) Draft │ │
│ │ (7) Guardrails │ │
│ └──┬────────┬──────────────────────────┘ │
│ │ │ │
│ ▼ ▼ │
│ ┌───────┐ ┌──────────────┐ │
│ │MongoDB│ │Elasticsearch │ │
│ │tickets│ │ kb_articles │ │
│ │feedbk │ │ kb_vectors │ │
│ │audit │ │ │ │
│ └───────┘ └──────────────┘ │
│ │
└──────────────────────────────────────────────────────────────────┘

│ (3,5,6) LLM API calls
│ (4) Embedding API call

┌──────────────────────────────────────────────────────────────────┐
│ TRUST BOUNDARY: Google Cloud (External) │
│ │
│ ┌─────────────────────────────────────┐ │
│ │ Vertex AI │ │
│ │ - Gemini (LLM) │ │
│ │ - text-embedding-005 │ │
│ │ (via Service Account auth) │ │
│ └─────────────────────────────────────┘ │
└──────────────────────────────────────────────────────────────────┘

Data Flow Legend

#FlowDataProtocol
1Browser → APITicket ID, feedback payloadHTTPS (REST)
2API → PipelineTicket text, metadataInternal function call
3Pipeline → Vertex AITicket text + promptHTTPS (gRPC via SDK)
4Pipeline → ElasticsearchQuery embedding + search queryHTTP (internal)
5Pipeline → Vertex AITicket + KB context + promptHTTPS (gRPC via SDK)
6Pipeline → Vertex AITicket + KB + reasoning + promptHTTPS (gRPC via SDK)
7Pipeline → PipelineAll outputs → guardrail checksInternal function call
8API → BrowserFull pipeline output (JSON)HTTPS (REST)

3. STRIDE Analysis

3.1 Spoofing

#ThreatComponentSeverityPilot ExposureMitigation
T-01Unauthorized API access -- attacker calls backend API directly without authenticationExpress APIMediumLow (internal network)Pilot: CORS restriction to frontend origin. Production: add JWT auth, API keys
T-02GCP Service Account key theft -- leaked key grants Vertex AI accessLLM GatewayHighMediumStore key as env var or GCP Secret Manager; never commit to Git; rotate on suspicion
T-03Agent impersonation -- one agent submits feedback as anotherFeedback APILowLow (pilot is internal team)Pilot: accept risk (internal users). Production: tie feedback to authenticated session

3.2 Tampering

#ThreatComponentSeverityPilot ExposureMitigation
T-04Prompt injection via ticket text -- malicious ticket content manipulates LLM behaviorPipeline (all LLM steps)HighMediumSystem prompt / user prompt separation; guardrails layer detects common injection patterns; LLM instructed to treat ticket as data, not instructions
T-05KB article tampering -- modified KB content causes incorrect responsesElasticsearchMediumLow (static dataset)Pilot: KB is read-only after ingestion. Production: access controls on KB update API; audit log on changes
T-06Audit log tampering -- modifying decision trail to hide bad outputsMongoDB (audit_log)MediumLowPilot: append-only writes; no delete API exposed. Production: immutable audit store

3.3 Repudiation

#ThreatComponentSeverityPilot ExposureMitigation
T-07Agent denies seeing copilot output -- no proof of what was shownAudit trailLowLowEvery pipeline run logged with full output, timestamp, ticket_id. Audit log is the proof.
T-08Feedback without attribution -- cannot trace who approved/rejected a responseFeedback systemLowLowPilot: single-user environment. Production: require agent_id in feedback payload

3.4 Information Disclosure

#ThreatComponentSeverityPilot ExposureMitigation
T-09PII leakage in draft response -- copilot echoes customer PII from ticket into response unnecessarilyDraft pipeline stepHighMediumGuardrails layer checks draft for PII patterns (SSN, email, phone); prompt instructs model not to echo PII unless relevant to resolution
T-10Ticket data exposed to LLM provider -- customer ticket content sent to GoogleVertex AI API callsMediumMediumAccepted risk for pilot (Google Cloud ToS covers data handling). Production: evaluate data processing agreements; consider on-prem LLM
T-11API returns excessive data -- pipeline output includes internal metadata in responseExpress APILowLowAPI response schema defined; strip internal fields before returning to frontend
T-12Secrets in logs or error messages -- stack traces expose env vars or API keysExpress APIMediumMediumError handling middleware returns generic error messages; structured logging excludes sensitive fields

3.5 Denial of Service

#ThreatComponentSeverityPilot ExposureMitigation
T-13LLM rate limiting -- excessive pipeline calls exhaust Vertex AI quotaVertex AIMediumLow (low pilot volume)Monitor API usage; implement request queuing; set per-minute rate limit on copilot endpoint
T-14Large ticket text causes timeout -- excessively long ticket overwhelms pipelinePipelineLowLowTruncate ticket text to max token limit before sending to LLM; set pipeline timeout (15s hard limit)
T-15Elasticsearch resource exhaustion -- expensive queries consume all memoryElasticsearchLowLow (small dataset)Set query timeout; limit kNN candidates; monitor ES health

3.6 Elevation of Privilege

#ThreatComponentSeverityPilot ExposureMitigation
T-16Prompt injection escalates to system-level actions -- injected prompt causes LLM to call unauthorized tools or APIsPipelineMediumLow (no tool-use configured)Pipeline uses structured output only; no function-calling / tool-use enabled; LLM cannot execute code or make external calls
T-17MongoDB injection -- malicious input in ticket text used to construct MongoDB queryData ServiceMediumMediumUse parameterized queries (Mongoose ODM); never interpolate user input into query strings
T-18Frontend XSS -- draft response contains script content rendered unsanitized in the browserReact FrontendMediumMediumReact auto-escapes JSX content by default; avoid using raw HTML injection; sanitize any rich content with a library like DOMPurify; set CSP headers

4. Top Threats (Ranked)

RankIDThreatSeverityLikelihoodPriorityOwner
1T-04Prompt injection via ticket textHighMediumCriticalAtharva + Shubham
2T-09PII leakage in draft responseHighMediumCriticalAtharva + Shubham
3T-02GCP Service Account key theftHighLowHighAmit
4T-18Frontend XSS via draft responseMediumMediumHighAmit
5T-17MongoDB injectionMediumMediumHighAmit + Nancy
6T-10Ticket data exposed to LLM providerMediumHigh (by design)MediumShubham
7T-12Secrets in logs/errorsMediumMediumMediumAmit

5. Secrets Management

Inventory

SecretStorageAccess MethodRotation
GCP Service Account key (JSON)GCP Secret Manager or env varGOOGLE_APPLICATION_CREDENTIALS env varOn suspicion of compromise
MongoDB connection string.env file (local) / env var (deployed)MONGODB_URI env varOn credential change
Elasticsearch credentials.env file (local) / env var (deployed)ES_URL env varOn credential change
LLM provider API keys (fallback).env file (local) / env var (deployed)OPENAI_API_KEY, ANTHROPIC_API_KEY env varsQuarterly

Rules

  • No secrets in code: .env is in .gitignore; .env.example contains placeholder values only
  • No secrets in logs: Logging middleware strips sensitive fields
  • No secrets in error responses: Error handler returns generic messages
  • Service Account key never committed: Key file path set via env var, file excluded from Git
  • .env.example documents all required vars without actual values

6. Guardrails Mapping

Each guardrail addresses one or more threats:

GuardrailThreats MitigatedImplementation
Profanity filter-- (content quality, not security)Word list + regex matching on draft output
PII checkT-09 (PII leakage)Regex patterns for SSN, email, phone, credit card in draft output; flag if found
Prompt injection detectionT-04 (prompt injection)Pattern matching for common injection phrases ("ignore previous", "system prompt", etc.) in ticket text
Confidence gatingT-04 (indirect -- low confidence may indicate manipulation)Flag if any step confidence < 0.5
Hallucination check-- (accuracy, not security)LLM-judge verifies all claims trace to cited KB articles
Input length limitT-14 (DoS via large input)Truncate ticket text > 4,000 tokens

7. Compliance Considerations

AreaPilot StatusProduction Requirement
Data residencyData on GCP (Gyde account, region TBD)Client's on-prem infrastructure; data never leaves their network
Data processing agreementVertex AI processes ticket text per Google Cloud ToSEvaluate DPA with Google; or switch to on-prem LLM
PII handlingExcel dataset may contain simulated PIIProduction: PII policy required; data minimization; retention limits
Audit trailAll copilot decisions loggedProduction: define retention period; access controls on audit data
Access controlSingle-user pilot; no authProduction: role-based access; SSO integration
Data retentionNo policy for pilotProduction: define retention and deletion policies per client requirements

8. Action Items

#ActionOwnerDueStatus
1Implement prompt injection guardrail (T-04)Shubham + AtharvaSprint 2 (May 11-13)Pending
2Implement PII check guardrail (T-09)Shubham + AtharvaSprint 2 (May 11-13)Pending
3Verify GCP Service Account key is not in Git (T-02)AmitSprint 1 Day 1 (May 1)Pending
4Implement input sanitization / XSS prevention (T-18)AmitSprint 1 (S1-10)Pending
5Use parameterized queries in MongoDB (T-17)Amit + NancySprint 1 (S1-02, S1-09)Pending
6Configure structured logging without secrets (T-12)AmitSprint 1 (S1-01)Pending
7Document data handling in Vertex AI calls (T-10)ShubhamSprint 1Pending
8Build adversarial test cases for injection + PII (T-04, T-09)Nishka + ShubhamSprint 2 (S2-03)Pending
9Full security review and sign-offShubhamSprint 2 (S2-10, May 14-15)Pending

9. Review Schedule

ActivityWhenParticipants
Initial threat model reviewMay 1 (this document)Shubham + Amit
Threat model update (post-M1)May 10 (Sprint 1 demo)Shubham
Security review (pre-delivery)May 14-15Shubham + Amit
Security sign-offMay 15Shubham

Change Log

DateChangeBy
2026-05-01Initial threat model created with 18 threats across STRIDE categoriesShubham + Amit

Threat modeling is a non-negotiable framework requirement (Doc 01, Section 5.1). This initial model identifies the threat surface; full validation occurs during the security review in Sprint 2.