How to use Literal Security
You connect Literal Security once, in your AI tool's settings. From then on, every time your AI writes code, our scan engine runs in the same loop — leaked secrets, SQL injection, missing auth checks, typosquatted dependencies — caught and auto-fixed before they hit your disk.
What is Literal Security, in one paragraph
Literal Security is a live security guardrail for AI-generated code. It runs inside your AI tool's loop: when the AI writes a file, our service scans it in real time, returns findings, and your AI rewrites the code to fix them. You never see the bug; the bug never ships. Works in Lovable, Replit Agent, Bolt.new, v0, Base44, ChatGPT Codex, Cursor, VS Code, Windsurf, Cline, and Claude Code.
Getting started — 60 seconds
- Create an account (no credit card).
- Create your first project — you'll get a bearer token.
- Pick your AI tool below and follow the 2-step setup. Paste two values, save.
- Prompt your AI normally. Findings will appear inline; the AI auto-fixes them.
Set up · Lovable
1. Open Lovable → Workspace Settings → Chat Connectors → Add MCP server.
2. Paste:
Server URL: https://api.literalsec.com/mcp Bearer token: smcp_<your-token-from-dashboard>
3. Open any Lovable project and prompt the agent. Literal Security will be available among its tools.
Set up · Replit Agent
1. Inside your Repl, open the Agent panel.
2. Settings → MCP servers → Add. Paste:
{
"literalsec": {
"url": "https://api.literalsec.com/mcp",
"headers": { "Authorization": "Bearer smcp_<your-token>" }
}
}
Set up · Bolt.new
1. In your Bolt project: Settings → Integrations → MCP.
2. Add a new MCP server with our URL and token. The agent will detect Literal Security tools on the next prompt.
Set up · v0 (Vercel)
v0 supports MCP via the Vercel AI SDK tool registry. Add Literal Security as a connected tool in your project settings.
URL: https://api.literalsec.com/mcp Bearer: smcp_<your-token>
Set up · Cursor
1. Open Settings → MCP → Add new MCP server.
2. Paste:
{
"mcpServers": {
"literalsec": {
"url": "https://api.literalsec.com/mcp",
"headers": { "Authorization": "Bearer smcp_<your-token>" }
}
}
}
Set up · Claude Code
One terminal command:
claude mcp add --transport http literalsec \ --url https://api.literalsec.com/mcp \ --header "Authorization: Bearer smcp_<your-token>"
Tell your AI to use us
Most AI tools will automatically discover and use connected MCP servers. To make it bulletproof — and to enforce the "always check before saving" rule — paste the following at the top of your AI tool's project rules / system prompt (e.g. .cursorrules, CLAUDE.md, or Lovable's project instructions):
Use Literal Security on every file change. Before saving any file: - Call secure_check(filename, content) and wait for the response. - If decision is "block": show me the findings, do not save. - If decision is "fix-required": fix the issues, re-call to verify. - If decision is "allow": save. Before any package install: call check_dependency. Before deploy: call pre_deploy_gate. Never silently skip Literal Security.
Block, fix-required, allow — what they mean
- block — the file has a critical issue (leaked credential, SQL injection, missing auth on a sensitive route). Do not save until fixed.
- fix-required — high-severity issues but not catastrophic. Save only after each one is addressed.
- allow — code is clean by our checks. Save freely.
Conservative by design: a few false positives are okay. False negatives — bugs we miss — are not. If a finding is wrong for your case, override it (next section). Don't bypass it silently.
Manual overrides — when a finding is wrong
If you're sure a finding is a false positive (test fixture code, accepted risk, etc.):
- Tell your AI: "Override the [stripe-key] finding because it's a test fixture key, already revoked."
- The AI will re-call
secure_checkwith your reason logged. - The override is recorded in your project's signed audit trail. You can review it later in the dashboard.
Inventing reasons or auto-overriding without your input is forbidden in our agent prompt — your AI is instructed to ask first.
Tokens & rotation
Each project has a bearer token (looks like smcp_xxxxxxx). Treat it like a password:
- Don't commit it to git. Don't put it in your source code. It only goes in your AI tool's settings.
- If you suspect it's been seen by anyone (you pasted it in a screenshot, someone watched you set it up), rotate it in your dashboard. Old token stops working immediately.
- Different tokens per project — don't reuse one token across multiple Lovable projects. One project = one token.
Privacy & data
- We see only the code your AI sends us for scanning, plus the chunks needed for cross-file checks.
- We do not train models on your code. We do not sell or share it.
- Receipts (signed records of what was checked) are kept per-project. Delete a project, and the cache is cleared.
- You can self-host the scan engine on Pro+ tiers if you'd rather we never see anything (roadmap).
Troubleshooting
"My AI doesn't seem to be calling Literal Security"
Most common causes:
- The MCP server isn't connected in the tool's settings — re-check the URL and bearer token.
- The bearer token is wrong or expired — copy a fresh one from the dashboard, paste it in.
- The agent's project rules / system prompt doesn't mention us — paste the snippet from Tell your AI to use us above.
"The check returned a 401"
Bad token, or your trial ended. Log in, check your account status, and rotate the token if needed.
"It's blocking something I'm sure is fine"
Use the override mechanism (above) — never disable Literal Security entirely. The override is signed and you can review it later.
"How do I cancel?"
Dashboard → account dropdown → Manage subscription. Cancellation is immediate; you keep access until the end of your billing period.