Skip to content

Governance Flags

Control agent behavior with a single header or SDK parameter.

agent = Agent("https://tappass.example.com", "tp_...", flags={
"mode": "observe",
"pii": "mask",
"email": "internal:company.com",
})

Or via HTTP header from any language:

X-TapPass-Flags: mode=observe, pii=mask, email=internal:company.com

Overall governance posture.

ModeBehavior
observeFull pipeline runs, everything logged, nothing blocked.
warnDetections logged and flagged, traffic flows through.
enforceDetections trigger configured actions (block, redact, notify). Default.
lockdownAny detection triggers a block.

Email tool call restrictions.

ModeBehavior
mirror:<address>All emails redirect to <address> with [AI TEST] prefix.
internal:<domain>Only @<domain> recipients allowed.
blockAll email tool calls blocked.
allowNo restrictions. Default.

PII handling in responses.

ModeBehavior
maskPII replaced with [MASKED_EMAIL], [MASKED_SSN], etc.
blockResponse blocked if PII detected.
flagPII logged but passed through.
offNo PII scanning. Default.

Cost and token caps.

ModeBehavior
dev$1/session, $5/day.
standard$10/session, $50/day.
custom:<per_call>:<per_session>Your own limits.
unlimitedNo caps. Default.

Tool call restrictions.

ModeBehavior
allowlist:<tool1>:<tool2>Only listed tools can execute.
denylist:<tool1>:<tool2>Listed tools blocked.
logAll tool calls logged with full arguments. Default.
blockNo tool calls. Chat only.

File operation restrictions.

ModeBehavior
read_onlyReads allowed, all writes blocked.
projectWrites only within the workspace directory.
blockNo file operations.
allowUnrestricted. Default.

Database operation restrictions.

ModeBehavior
read_onlySELECT only.
safe_writeSELECT, INSERT, UPDATE. No DELETE/DROP/TRUNCATE. Default.
blockNo database operations.

Secret handling in responses.

ModeBehavior
redactAPI keys, tokens, passwords replaced with [REDACTED]. Default.
blockResponse blocked if secrets detected.
flagSecrets logged but passed through.

agent = Agent("https://tappass.example.com", "tp_...", flags={
"pii": "mask",
"email": "internal:company.com",
})
response = agent.chat(
"Send the salary report",
flags={"email": "block", "mode": "lockdown"},
)
from openai import OpenAI
client = OpenAI(base_url="https://tappass.example.com/v1", api_key="tp_...")
response = client.chat.completions.create(
model="gpt-4o",
messages=[{"role": "user", "content": "Hello"}],
extra_headers={"X-TapPass-Flags": "pii=mask, email=block"},
)
Terminal window
export TAPPASS_FLAGS="mode=observe, pii=mask"

Safe testing:

agent = Agent(url, key, flags={
"mode": "observe",
"email": "mirror:me@company.com",
"budget": "dev",
})

Production:

agent = Agent(url, key, flags={
"email": "internal:company.com",
"pii": "mask",
"secrets": "redact",
})

Incident response:

agent = Agent(url, key, flags={
"mode": "lockdown",
"email": "block",
"tools": "block",
"files": "read_only",
})

Customer-facing chatbot:

agent = Agent(url, key, flags={
"tools": "block",
"pii": "mask",
"secrets": "redact",
"budget": "custom:0.10:5",
})

X-TapPass-Flags: flag1=mode1, flag2=mode2:param1

Comma-separated key=value pairs. Values can include colon-separated parameters. Unknown flags and invalid modes are silently ignored.