medcore-ai-route-audit

Codify PHI-safe inference audit rows and prompt sanitization for MedCore AI routes.

2|3|Updated Apr 13, 2026
One-click install
npx skills add https://github.com/Globussoft-Technologies/medcore --skill medcore-ai-route-audit
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: medcore-ai-route-audit
Source: https://github.com/Globussoft-Technologies/medcore/tree/main/.claude/skills/medcore-ai-route-audit
Command: npx skills add https://github.com/Globussoft-Technologies/medcore --skill medcore-ai-route-audit

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill prevents missing or inconsistent inference audit logging and prompt-injection vulnerabilities across MedCore AI endpoints, ensuring observability without leaking PHI.

Core Features & Use Cases

  • Inference audit-row contract: Adds the canonical AI_<FEATURE>_INFERENCE row with model, prompt/response size, and latency in a PHI-safe way.
  • Prompt-injection sanitization: Applies sanitizeUserInput to every free-text prompt field before it reaches the LLM/ASR prompt template.
  • Test coverage that enforces safety: Pins success and failure paths, asserts negative PHI hygiene (forbidden keys absent), and verifies the sanitization behavior.
  • Use during onboarding and remediation: Apply when adding new ai-*.ts routes, when an audit finding flags gaps, or when new free-text fields are introduced into prompts.

Quick Start

When you add a new AI route under apps/api/src/routes/ai-*.ts, apply this skill’s contract to stamp the model constant, sanitize all free-text prompt inputs with sanitizeUserInput, and add the paired test that asserts both inference audit-row correctness and PHI-absence.

Frequently Asked Questions about medcore-ai-route-audit

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
Why does my AI endpoint need prompt-injection defense for free-text inputs?

Prompt-injection defense for AI endpoints requires sanitizing all user free-text prompt inputs with sanitizeUserInput before they reach the LLM or ASR prompt template, preventing malicious payload execution.

When should I apply inference audit contracts to my ai-*.ts route files?

Testing AI route sanitization requires adding tests that assert sanitizeUserInput behavior and verify forbidden PHI keys are absent from audit details across both success and failure paths.

When should I apply inference audit contracts to my ai-*.ts route files?

To add PHI-safe inference audit logging to LLM routes, stamp a route-level model constant and write AI_<FEATURE>_INFERENCE rows containing model, promptSize, responseSize, and latencyMs on both success and failure.

Why does my AI endpoint need prompt-injection defense for free-text inputs?

Testing AI route sanitization requires adding tests that assert sanitizeUserInput behavior and verify forbidden PHI keys are absent from audit details across both success and failure paths.

Why does my AI endpoint need prompt-injection defense for free-text inputs?

Apply inference audit contracts when creating or updating apps/api/src/routes/ai-*.ts endpoints, onboarding new AI features, fixing audit findings about missing logging, or introducing new free-text fields into prompts.