You deployed Copilot to your team 6 months ago. Increased velocity 20%. Everyone loves it. Last week, your co-founder asked: "Where does our code actually go?" You don't have an answer. A compliance officer auditing your HIPAA readiness asks the same question. You realize you've been sending production data, test fixtures with fake user IDs, and database credentials to GitHub, Anthropic, OpenAI, and Codeium—and you have no audit trail.
That's the scenario facing 60% of SaaS teams using AI code tools without security review. This guide walks you through a 60-minute audit to find out exactly what's leaving your codebase, what tools are safe, and what policies you need before your next fundraise or security review.
What Changed: GitHub's April 2026 Telemetry Shift + Compliance Wake-up Call
In April 2026, GitHub enabled data training for Copilot Free, Pro, and Pro+ by default. Copilot Enterprise (the only BAA-eligible tier for healthcare) starts at $30/user/month. Around the same time:
- EPC Group launched a "Copilot Safety Blueprint" (starting $15K for readiness assessment, up to $500K+ for enterprise deployments) because founders couldn't build safe deployments themselves
- AgentShield launched as a runtime firewall for MCP servers (Aug 2026) — product exists because supply-chain risk is real
- Cursor compliance audit skill appeared in Smithery marketplace — the market is signaling demand for audits For regulated industries (healthcare, fintech, edtech), the gap is urgent. Healthcare startups building with Copilot without a Business Associate Agreement expose Protected Health Information (PHI), violating HIPAA. Fintech startups built with Cursor send API keys and account numbers to external inference endpoints. No tools flag this automatically.
Real data point: University of Miami IT published a statement: "Copilot is specifically designed for enterprise use, ensuring compliance with University of Miami security, data protection, and privacy standards—however, please keep in mind that Copilot is currently not HIPAA compliant." (January 2024)
The problem: founders deploy AI tools because they solve velocity. Compliance teams audit 6 months later and find the tools weren't approved.
The Audit: 7 Phases in 60 Minutes
Phase 1: Inventory Your Tools (5 minutes)
First, list every AI coding tool active in your team.
Check VS Code / Cursor:
# List all extensions (may include AI tools)
code --list-extensions | grep -i "copilot\|cursor\|cline\|continue"Common suspects:
- GitHub Copilot (VSCode / GitHub.com)
- Cursor (desktop app)
- Cline (VSCode extension, Claude-based)
- Continue (open-source, VSCode)
- Windsurf (Codeium's editor)
- Anthropic Claude Code (desktop)
- JetBrains AI (IntelliJ/PyCharm) Output: Create a spreadsheet with tool name + version + # of team members using it.
Phase 2: Scan Your Codebase for Exposed Secrets (15 minutes)
Before you worry about what AI tools send, find out what secrets are already in your repo.
Install gitleaks (fastest, no signup):
# macOS
brew install gitleaks
# Linux
curl -sSL https://github.com/gitleaks/gitleaks/releases/download/v8.19.0/gitleaks-linux-x64 -o gitleaks
chmod +x gitleaksScan your git history for secrets:
# Scan all commits, all branches (in current directory)
gitleaks detect --source . --verbose
# Output findings to JSON (easier to parse)
gitleaks detect --source . --report-format json --report-path gitleaks-report.json
# Scan with limited output (faster first pass)
gitleaks detect --source . --max-target-megabytes 50 --log-level warnWhat you'll see:
Finding: AWS_ACCESS_KEY_ID=AKIAIOSFODNN7EXAMPLE
Severity: CRITICAL
Match: AKIAIOSFODNN7EXAMPLE
Secret: true
File: .env.local (COMMITTED 3 months ago)
Commit: abc1234...Critical findings:
- ❌ AWS access keys (AKIAIOSFODNN...)
- ❌ GitHub tokens (ghp_...)
- ❌ Stripe API keys (sk_live_...)
- ❌ Database passwords (in .env files, Dockerfiles)
- ❌ User data in test fixtures (emails, phone numbers in seed scripts) Action: For each critical finding, revoke the credential immediately (AWS IAM → delete key, GitHub → regenerate token). Commit a remediation.
Phase 3: Check What's in Your .env and Config Files (5 minutes)
Now check current (uncommitted) secrets.
# Find all .env files
find . -name ".env*" -o -name "*.secrets" | head -20
# Grep for common secret patterns in untracked files
git status --short | grep -E "\.env|secrets|config" | while read file; do
echo "=== $file ===" && head -5 "$file"
doneManual spot-check:
- Do
.env.local,.env.productionfiles live in your git repo or just developers' machines? - Are API keys hardcoded in source files (BAD) or injected at runtime (GOOD)?
- Does your CI/CD pass secrets via GitHub Secrets or commit them to a private repo file (RISKY)?
Phase 4: Review AI Tool Telemetry & Data Usage Policies (10 minutes)
Each tool has different defaults for what it sends.
GitHub Copilot (all tiers):
Go to https://github.com/settings/copilot
Look for:
- ☑️ "Allow GitHub to use my code snippets from the code editor for product improvements" (UNCHECK if you're Copilot Free/Pro)
- ☑️ "Allow GitHub to use my prompts, suggestions, and code snippets for AI model training" (should already be OFF in Sep 2026, but verify) Copilot Business / Enterprise: Prompts are NOT retained after suggestion. No telemetry opt-out needed (prompts stay in volatile memory). Verify your organization has a signed Business Associate Agreement (BAA) if handling PHI.
# Check your org's Copilot settings (admin-only)
# https://github.com/organizations/{ORG_NAME}/settings/copilot
# Look for: Data usage controls, telemetry, model training togglesCursor (desktop app):
Open Settings → Privacy & Telemetry
- "Share usage data with Codeium" → UNCHECK
- "Send crash reports" → UNCHECK (optional, up to you)
- Check your API key usage: https://codeium.com/profile/api-keys Cursor uses your codebase for context (indexes locally), but if you connected to an external LLM (Claude, GPT-4), verify the connection is authenticated and logged.
Cline (VS Code extension):
Open .cline config in your project root (if it exists) or create one:
{
"models": [
{
"id": "claude-opus-4-1",
"provider": "anthropic",
"apiKeyVariable": "ANTHROPIC_API_KEY"
}
],
"exclude_dirs": [
".git",
"node_modules",
".env",
"**/*.key",
"**/*.pem"
],
"enable_telemetry": false
}Continue (open-source):
Config at ~/.continue/config.json
{
"models": [
{
"title": "Claude",
"provider": "anthropic",
"model": "claude-3-5-sonnet-20241022"
}
],
"tabAutocompleteModel": {
"title": "Claude",
"provider": "anthropic"
},
"allowAnonymousTelemetry": false
}Output: Document which tools are connected to which endpoints. Example:
| Tool | Model | Provider | API Key | Data Retention | Telemetry | BAA? |
|---|---|---|---|---|---|---|
| Copilot | GPT-4 | OpenAI (GitHub) | Team org key | Discarded after suggestion | DISABLED | NO |
| Cursor | Claude 3.5 Sonnet | Anthropic | User's personal key | Per Anthropic policy | DISABLED | NO |
| Cline | Claude Opus 4.1 | Anthropic | ANTHROPIC_API_KEY env | Per Anthropic policy | DISABLED | NO |
Phase 5: Implement Guardrails in Code (20 minutes)
Now set rules so developers can't accidentally send sensitive data.
Create .cursorrules file (Cursor-specific):
You are a code assistant for a production SaaS application.
CRITICAL: Never suggest code that includes:
- User credentials, API keys, or tokens (even as examples)
- Database connection strings with passwords
- Real user emails, phone numbers, or PII (use placeholders like user@example.com)
- Healthcare data, financial records, or regulated information
- Entire private methods from third-party libraries (summarize instead)
If the user pastes code with secrets, alert them immediately and ask them to redact before proceeding.
When writing code:
1. Use environment variables for all credentials (const apiKey = process.env.API_KEY)
2. Never log sensitive data
3. Validate input before passing to external APIs
4. Include explicit data classification comments (e.g., // PII, do not log)
Frameworks in use: Node.js, Express, MySQL. Use these patterns by default.Save to .cursorrules in repo root. Cursor will load it automatically.
Create .cline-rules (if using Cline):
Same content as .cursorrules but in a comment at the top of .cline/instructions.md:
# Cline Instructions for This Repo
**Data Protection Policy:**
- Never suggest code that includes credentials, API keys, or user PII
- Always use env vars for secrets
- Flag any PHI/PII in user input before proceeding
- Do not log sensitive data
[rest of rules...]Add secret scanning to CI/CD (GitHub Actions):
Create .github/workflows/secret-scan.yml:
name: Secret Scanning
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main ]
jobs:
gitleaks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install gitleaks
run: |
curl -sSL https://github.com/gitleaks/gitleaks/releases/download/v8.19.0/gitleaks-linux-x64 -o gitleaks
chmod +x gitleaks
- name: Scan for secrets
run: ./gitleaks detect --source . --verbose --exit-code 1This blocks any PR that introduces new secrets.
Phase 6: Document Your Audit Findings (5 minutes)
Create COMPLIANCE.md in your repo root:
# AI Tools Compliance Audit
**Date:** 2026-09-25
**Auditor:** [Name]
**Status:** ✅ PASSED / ⚠️ NEEDS REMEDIATION / ❌ BLOCKED
## Tools Approved for Use
| Tool | Tier | Data Retention | PHI Allowed? | Comment |
|------|------|----------------|--------------|---------|
| Copilot | Free (personal) / Business (org) | Copilot Business: no retention | NO | Telemetry disabled |
| Cursor | Free | Per Anthropic policy | NO | No Business tier available |
| Cline | Free (OSS) | Per Anthropic policy | NO | Configured via .cline rules |
## Secret Scanning Results
- Scan date: 2026-09-25
- Gitleaks findings: 2 CRITICAL (AWS key, DB password)
- Status: REVOKED and remediated
- Next scan: Weekly (automated in CI/CD)
## Developer Policy
1. Never paste credentials, API keys, or user data into AI tools
2. Use placeholder data in prompts (user@example.com instead of real emails)
3. Review AI suggestions before committing (watch for credential leakage)
4. Report suspected leaks to security@company.com immediately
## Compliance Status
- ☑️ No PHI/PII in codebase
- ☑️ Secrets scanning enabled in CI/CD
- ☑️ AI tool telemetry disabled
- ☑️ Guardrails (.cursorrules, .cline rules) in place
- ⚠️ Copilot Enterprise BAA: NOT PURCHASED (cannot use with PHI)
## Next Steps
- [ ] Security review by [person] before next release
- [ ] Team training: "Safe AI tool usage" (15 min doc)
- [ ] Quarterly re-audit (check for new tools, policy updates)Commit this to version control so your auditor or compliance officer can see you've done the work.
Phase 7: Ongoing Monitoring (recurring, 10 min/month)
Weekly (automated):
- CI/CD runs gitleaks on every PR
- GitHub Actions alerts if secrets detected Monthly (manual):
- Re-run gitleaks on entire history:
gitleaks detect --source . - Check for new AI extensions:
code --list-extensions | grep -i copilot - Verify .cursorrules and .cline rules are being followed (spot-check commits) Quarterly:
- Full audit (repeat all 7 phases)
- Update COMPLIANCE.md with findings
- Review with security/compliance stakeholder
When to Block AI Tools (Honest Assessment)
✅ Use AI tools when:
- You have no regulated data (PHI, PII, financial records, credentials)
- Your AI tool has a signed BAA (Copilot Enterprise only, for healthcare)
- You control the model (self-hosted Claude via private API key)
- You've audited the codebase for secrets and passed
- You can enforce guardrails (.cursorrules, secret scanning) ❌ Block AI tools when:
- You handle HIPAA data and don't have Copilot Enterprise BAA
- You handle PCI data (payment cards) without explicit vendor agreement
- Your codebase has unrevoked credentials (gitleaks findings)
- Your team won't follow guardrails (use AI code intel instead of auto-complete)
- You're SOC 2 audited and can't log every AI request + response The hard truth: Most SaaS teams at Series A+ can't use free Copilot because the telemetry risk outweighs the velocity gain. They need either:
- Copilot Enterprise ($30/user/month, BAA included)
- Self-hosted Claude via private API key ($0.042/MTok, you control retention)
- Cursor + Anthropic contract (if you can negotiate one) The fastest teams use option 2 or 3. The most compliant teams use Copilot Enterprise or nothing.
Decision Matrix: Should We Use This Tool?
| Scenario | Tool | Decision | Why |
|---|---|---|---|
| Healthcare startup, no BAA | Copilot Free | ❌ BLOCK | PHI violation |
| Healthcare startup, BAA signed | Copilot Enterprise | ✅ ALLOW | BAA covers PHI |
| Fintech, Stripe data in tests | Cursor | ⚠️ AUDIT FIRST | External API inference |
| SaaS (no regulated data) | Cursor + Cline | ✅ ALLOW | No BAA needed |
| Pre-seed, no compliance yet | Copilot + Cursor | ✅ ALLOW | Not required |
| Post-Series A, SOC 2 audit | Copilot Enterprise | ✅ ALLOW | Telemetry + audit trail |
Audit Checklist (Print This)
- Phase 1: Inventoried all AI tools (spreadsheet created)
- Phase 2: Ran gitleaks, identified secrets, revoked credentials
- Phase 3: Checked .env files, no unencrypted secrets in git
- Phase 4: Verified AI tool settings (telemetry disabled, no BAA=no PHI)
- Phase 5: Created
.cursorrulesand secret scanning CI/CD - Phase 6: Documented findings in
COMPLIANCE.md - Phase 7: Scheduled monthly/quarterly re-audits
- Decision: Team can/cannot use AI tools per policy
- Sign-off: CTO / Security lead approval
Expected time: 60 minutes for 10-person team
Expected outcome: "We know exactly what's leaving our codebase and we've blocked the risky stuff"
Got stuck, or want this shipped end-to-end for you? bitroot.club builds custom products for founders. →