Skip to main content
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.
Step 1 — In your terminal, install the SDK:
Terminal
Step 2 — Create a new file 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
Step 3 — Back in your terminal, run the file:
Terminal
You should see 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).
The rest of this page covers production concerns — fail-policy, BYOK vs Managed, streaming, tools, Express/Flask app structure, and the full failure-mode reference. Skip ahead only if you need them.

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
Pricing: $180 per 1,000,000 tokens. Counted on 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 a governance 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_KEY env var in production — not needed (the upstream key lives encrypted inside PromptWall in BYOK mode, or PromptWall’s Managed pool covers it)
After migrating to Full Control, you can clean up:
Then remove the relevant lines from 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

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
Get the key from prompt-wall.com/settings → Apps tab:
  1. Click + New App
  2. Choose mode Full Control
  3. Pick BYOK or Managed (see comparison above)
  4. If BYOK: paste your OpenAI / Anthropic / Bedrock key — it’s encrypted with KMS and never leaves the gateway
  5. 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.
Before:
services/chat.py (before)
After (the OpenAI client is gone — PromptWall handles the LLM call):
services/chat.py (after)
That’s it — one call, the answer is already governance-checked.
Drop-in for OpenAI clients. If your code uses openai.OpenAI(base_url=..., api_key=...), you can switch to Full Control without the SDK by setting:
The /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
To test a pre-flight block (PromptWall stops the prompt before it even hits the LLM):
The trace should show 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

Set PROMPTWALL_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 same session_id so /sessions can replay the thread:

Tool / function calling

Forward the same tools array your LLM SDK expects. PromptWall passes it through and runs prompt-injection checks on tool outputs before re-injecting them into the conversation:
When a tool is called, you’ll see a separate trace row in /traces with the tool result governance-checked.

Streaming

Set stream: 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

Then on /traces filter by 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.
File: requirements.txt (create new)
requirements.txt
File: .env (create new — gitignore it)
.env
File: lib/promptwall_client.py (create new — same as Step 3)
lib/promptwall_client.py
File: app.py (create new — full server)
app.py
Run it:
You’ll get the answer back, governance-checked, in a single round trip — with no openai package anywhere in the stack.

Node.js (Express)

Project layout — same idea. Notice openai is not in package.json.
File: package.json (create new)
package.json
File: tsconfig.json (create new)
tsconfig.json
File: .env (create new — gitignore it)
.env
File: src/promptwall.ts (create new — same as Step 3)
src/promptwall.ts
File: src/server.ts (create new — full server)
src/server.ts
Run it:
Single endpoint, single dependency (@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_id is set)
  • /billing — credit consumed at $180/M tokens for full-control, plus upstream LLM cost (BYOK pass-through or Managed inclusive)
Full-Control traces are flagged with the Full Control mode badge.

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.