Full Control mode replaces your direct LLM call. Instead of
hitting OpenAI / Anthropic / Bedrock yourself, you
POST /v1/chat and
PromptWall handles the LLM call for you — running policy checks
before the prompt hits the model, and on the model’s answer
before it returns. One request in, one safe answer out.⚡ 30-second integration
Three steps. Each step says exactly where the code goes — terminal or a specific file.- 🐍 Python
- 🟨 Node.js
- 🔧 cURL
Step 1 — In your terminal, install the SDK:Step 2 — Create a new file Step 3 — Back in your terminal, run the file:You should see
Terminal
test_promptwall.py in any folder.
Paste this exactly. Replace pk_live_xxxxxxxx with your real key from
prompt-wall.com/settings → Apps → + New App → Full Control:test_promptwall.py
Terminal
answer: Paris is the capital of France. and
governance: allow. That’s a working integration.Don’t have an API key yet? Sign up at
prompt-wall.com/signup (free —
$50 of credits), then click + New App in Settings and pick mode
Full Control. Copy the
pk_live_… key shown on the final step
(it’s only displayed once — save it).When this mode is right for you
✅ Pick Full Control when…
- You want maximum enforcement — block jailbreaks at the prompt stage before the model sees them, and block leaks at the answer stage
- You want one API to call instead of two (LLM + Verify)
- You’re willing to give PromptWall your LLM key (BYOK) or use the Managed pool
- You need a single audit trail with prompt + answer + policy decisions in one record
❌ Don't pick Full Control if…
- You can’t change your LLM call site — pick Verify instead
- Your LLM is a private model PromptWall doesn’t yet support — pick Verify and keep the model in-house
- Cost is the dominant constraint — Full Control is the most expensive mode at $180/M tokens
prompt_tokens + completion_tokens returned by the underlying LLM.
PromptWall passes the upstream LLM cost through at-cost (BYOK) or
included (Managed).
What you’ll build
You make one HTTP call. PromptWall makes the LLM call internally. The response shape mirrors OpenAI’s chat-completions schema plus agovernance block, so you can drop Full Control in by changing your
base URL.
Python vs Node.js — what’s actually different?
Nothing about the API. The same JSON goes to the same endpoint. The only differences are:
Pick the one your app is already in. There’s no functional advantage
to one over the other — both hit the same
/v1/chat endpoint with
the same payload.
”Do I still need the OpenAI / Anthropic SDK?”
Short answer: no. Full Control replaces it.- ❌
pip install openai— not needed (PromptWall handles the LLM call) - ❌
npm install openai— not needed - ❌
OPENAI_API_KEYenv var in production — not needed (the upstream key lives encrypted inside PromptWall in BYOK mode, or PromptWall’s Managed pool covers it)
requirements.txt /
package.json and the OPENAI_API_KEY from your hosting platform’s
env vars.
Exception — OpenAI drop-in pattern. If you decided to keep using
the
openai SDK with a custom base_url (see the drop-in note in
Step 4), then yes, keep openai installed. You’re using its HTTP
client; you just point it at our endpoint instead.BYOK vs Managed — pick before you start
Full Control needs an upstream LLM key. Two ways to provide it:
Set this once in
Settings → Apps → your Full-Control app → LLM provider.
You can switch later without changing your client code.
Choose your integration
- 🐍 Python SDK
- 🟨 Node.js SDK
- 🔧 cURL / raw HTTP
- 📦 Other languages
Step 1 — Install the SDK
Step 2 — Add API key to your environment
Create new file:
.env (in your project root). If .env already
exists, add the line below. Confirm .env is in .gitignore..env
- Click + New App
- Choose mode Full Control
- Pick BYOK or Managed (see comparison above)
- If BYOK: paste your OpenAI / Anthropic / Bedrock key — it’s encrypted with KMS and never leaves the gateway
- Copy the
pk_live_…key shown on the final step (only displayed once)
Step 3 — Create a thin wrapper
Create new file:
lib/promptwall_client.py (or wherever you keep
shared infrastructure code).lib/promptwall_client.py
Step 4 — Wire into your existing LLM call
Edit existing file: wherever you call OpenAI / Anthropic / etc.
Common locations:
app.py, main.py, services/chat.py,
routes/chat.py. You will replace the LLM client call with the
PromptWall wrapper.services/chat.py (before)
services/chat.py (after)
Drop-in for OpenAI clients. If your code uses
The
openai.OpenAI(base_url=..., api_key=...), you can switch to Full
Control without the SDK by setting:/v1/chat/completions shape is OpenAI-compatible, with an extra
governance block in the response.Step 5 — Verify it worked
Run a request through your app, then open prompt-wall.com/observability.Within ~3 seconds you should see:- Requests counter ticked up
- A new row in Recent Traces with mode badge Full Control
- The pre-flight + post-flight decisions both visible
governance = block, stage = pre-flight,
reason = security.prompt_injection. Crucially, the LLM was never
called — you saved the LLM cost on this attempt.Step 6 — Deploy to production
SetPROMPTWALL_API_KEY as a secret in your hosting platform:If you have your old
OPENAI_API_KEY env var set in production, you
can leave it — Full Control ignores it (the upstream key lives inside
PromptWall now). Cleanup is optional.Common patterns
Multi-turn conversations
Pass the full message history on each call (OpenAI-style). PromptWall stores it under the samesession_id so /sessions can replay the
thread:
Tool / function calling
Forward the sametools array your LLM SDK expects. PromptWall passes
it through and runs prompt-injection checks on tool outputs before
re-injecting them into the conversation:
Streaming
Setstream: true in the request body. The response is
Server-Sent-Events compatible with OpenAI’s stream format, with one
extra final event carrying the governance block:
When streaming, the post-flight scan runs on the completed answer
after the stream closes. If a policy fires, you’ll get a final
governance: rewrite|block event — be ready to overwrite the
partially-rendered text in your UI. For high-stakes content, prefer
non-streaming.Per-environment splitting
Create one App per environment in Settings → Apps. Each gets its own API key and (in BYOK mode) its own upstream LLM key:Custom metadata for filtering
metadata.feature = "summarize-pdf".
Complete worked example — copy this into a new project
If snippets aren’t enough, here are two complete starter projects you can run today.Python (Flask)
Project layout — five files in a single directory. Notice the
OpenAI SDK is not installed.
requirements.txt (create new)
requirements.txt
.env (create new — gitignore it)
.env
lib/promptwall_client.py (create new — same as Step 3)
lib/promptwall_client.py
app.py (create new — full server)
app.py
openai package anywhere in the stack.
Node.js (Express)
Project layout — same idea. Notice
openai is not in
package.json.package.json (create new)
package.json
tsconfig.json (create new)
tsconfig.json
.env (create new — gitignore it)
.env
src/promptwall.ts (create new — same as Step 3)
src/promptwall.ts
src/server.ts (create new — full server)
src/server.ts
@promptwall/node), governance
included. No openai package needed.
Failure modes
The SDK retries idempotent failures (5xx + network) once with 100 ms
backoff before raising.
What you’ll see in the dashboard
Within seconds of your first chat call:- /observability — KPIs (requests, blocks, rewrites, tokens, cost), decisions chart split by stage (pre-flight vs post-flight)
- /traces — drill-down on each call: prompt, answer, both stages’ policy decisions, full tool-call sequence
- /sessions — multi-turn replay (if
session_idis set) - /billing — credit consumed at $180/M tokens for full-control, plus upstream LLM cost (BYOK pass-through or Managed inclusive)
Next steps
Tune your policies
Decide what counts as PII / brand-safety / off-topic for your tenant.
Set actions per severity (allow / warn / block / rewrite) — applies
to both pre-flight and post-flight stages.
Compare modes
Decision tree for picking Events vs Verify vs Full Control on each
use case. Most teams run multiple modes side-by-side.