Orchestration Flow
Developer sends prompt
A developer asks the code assistant: “Write a function that connects to our PostgreSQL database and queries the users table.”
TealGuard — Prompt injection scan
TealEngine — Input policy evaluation
Agent generates code
The AI agent generates a TypeScript function with database connection logic. The generated code includes a hardcoded connection string:
postgresql://admin:s3cretP@[email protected]:5432/users.TealSecrets — Output secret scan
HIGH and the secret is redacted from the response before it reaches the developer.TealRegistry — Model allowlist check
gpt-4-turbo) is on the organization’s allowlist. This prevents shadow AI usage — developers can’t route requests to unapproved models.TealMemory — Session scope governance
session scope only. When the session ends, the context is purged. This prevents proprietary code from persisting in long-term memory stores that could leak across users or sessions.Response to developer
The developer receives the generated code with the secret replaced by a placeholder:
postgresql://${process.env.DB_USER}:${process.env.DB_PASSWORD}@${process.env.DB_HOST}:5432/users. A warning note explains that a hardcoded credential was detected and replaced.Flow Diagram
Code Example
Key Governance Points
TealSecrets supports 500+ secret patterns including AWS keys, database connection strings, JWT tokens, private keys, and custom patterns. See the TealSecrets API reference for the full pattern list.
Related Documentation
Governing AI Coding Agents
Cookbook recipe with detailed coding agent governance patterns
TealSecrets API
Full API reference for secret detection and redaction
TealMemory API
Memory governance scopes and classification levels
TealRegistry API
Model and tool allowlisting configuration

