AI security assistant

SecureSBU

A Teams chatbot that answers HIPAA policy questions from the source documents.

Full Stack Engineer & Team Leader · 4 · Hackathon weekend (Nov 8–9, 2025)

Hours → seconds
Time to answer a policy question
50+
Edge-case queries tested
100%
Grounded answers across the edge-case test set
SecureSBU answering a policy question in Teams
SecureSBU answering a policy question in Teams

Context

Most HIPAA violations come from simple staff mistakes, and the policies that would prevent them are too long to read on shift.

The problem

Policy documents are long, complex and constantly changing, so staff cannot realistically keep up with them. A policy assistant in this setting must never make up an answer, because a wrong one is a compliance risk.

What I owned

I led the team and built the full stack: the React UI, the Express API, the MySQL audit log and the Teams and Discord integrations.

Frontend

ReactTypeScript

Backend

Node.jsExpressMySQL

AI

NeuralSeek (RAG)

Integrations

Microsoft Teams APIDiscord Webhook

Architecture

Every question passes a risk interceptor before it reaches NeuralSeek's RAG over the policy PDFs, and risky queries go to the security team instead.

Teams + React → Express → Risk Intercept → RAG → Policy DB → Incident Alert

swipe
MS Teams BotReact FrontendExpress API ServerRisk InterceptorNeuralSeek RAGPolicy PDF DBMySQL (audit log)Discord WebhookSecurity Team Alert
  1. Critical path
  2. MS Teams Bot
  3. →Express API Server
  4. →Risk Interceptor
  5. →NeuralSeek RAG
  6. →Policy PDF DB

Highlighted: the normal policy-question path, from Teams through the interceptor to RAG-grounded answers.

Key decisions

Two choices kept the assistant accurate and cheap to run: retrieval instead of fine-tuning, and webhooks instead of a bot.

Decision 1

RAG over fine-tuning

Problem
Policies change often, and answers must stay grounded in the current documents.
Options
  • Fine-tune a custom LLM
  • NeuralSeek's RAG framework over the policy PDFs
Decision
NeuralSeek RAG in strictMode over the SBUH_POLICIES knowledge base, returning citations with each answer.
Result
Uploading a new PDF updates the knowledge base with no retraining and no GPU resources.
Trade-off
Fine-tuning would give more control, and the system now depends on NeuralSeek's infrastructure.

Decision 2

Intercept risky queries before RAG

Problem
Some questions (PHI, passwords, breaches) point to a live incident rather than a policy lookup.
Options
  • Keyword interception ahead of the RAG call
Decision
A pattern check runs first. A match returns an INCIDENT_PROMPT with a report button, and reports alert the security team through a Discord webhook.
Result
The loop from a user spotting an issue to the team responding closes within seconds.
Trade-off
Webhooks were picked over a full Discord bot to keep deployment simple, so alerts only flow one way.

Measurement

Answering a policy question went from hours of manual lookup to seconds.

Time to answer a policy question

Before
Hours
After
Seconds

Reliability

When no policy matches, the bot says so and points to the security team instead of guessing.

  • Every answer is grounded in a verified policy source, and the test set of 50+ edge cases returned no hallucinated answers.
  • Graceful degradation: with no relevant policy, the reply is "I couldn't find a specific policy for this. Please consult with the security team directly."
  • Incident reports retry with exponential backoff to ride out temporary Discord API outages.
Edge cases covered (3)
  • Ambiguous queries
  • Multi-part questions
  • Queries with no direct policy match

Limits and scale

The risk check and the alert channel are deliberately simple and would need hardening before a hospital-wide rollout.

TodayRisk detection is a case-insensitive substring match on four keywords (PHI, personal email, password, breach).

At scale—

TodayAnswers depend on NeuralSeek being available, with no fallback.

At scale—

TodayAlerts go to a Discord webhook, which is one-way and outside the hospital's identity system.

At scale—

Engineering deep divePipelines, code flow and implementation notes

Key implementation

typescript
// Risk-Aware Query Interception
async function handleUserQuery(query: string, userId: string) {
  // 1. Detect sensitive keywords before RAG processing
  const sensitivePatterns = ['PHI', 'personal email', 'password', 'breach'];
  const isRiskQuery = sensitivePatterns.some(pattern => 
    query.toLowerCase().includes(pattern.toLowerCase())
  );
  
  if (isRiskQuery) {
    // Interrupt normal response flow
    return {
      type: 'INCIDENT_PROMPT',
      message: 'This query may indicate a security concern.',
      showReportButton: true,
      originalQuery: query
    };
  }
  
  // 2. Process through RAG with policy grounding
  const response = await neuralSeek.query({
    question: query,
    knowledgeBase: 'SBUH_POLICIES',
    strictMode: true  // Prevents hallucinations
  });
  
  return {
    type: 'POLICY_GUIDANCE',
    answer: response.answer,
    sources: response.citations
  };
}

Impact

Transformed security compliance from static documentation into dynamic, intelligent infrastructure. The chatbot reduced response time for policy questions from hours (manual lookup) to seconds, while the risk-aware incident reporting workflow closed the loop from user detection to team response within seconds.

← All projects