Skip to Content
Docs are being rebuilt — start at Introduction → How it works.

Pre/post hooks

A pre/post hook is a check that runs before an agent’s input reaches the model or after the model produces output. In TeamMate these before-and-after checks are configured as guardrails — there is no separate scripting or webhook hook system to manage. Use guardrails to validate, transform, or block content on every run, whether the agent is started by a person, a schedule, or a trigger.

Pre (input) checks

Input guardrails run on the user’s message before it is sent to the model. Each one can:

  • Allow the input through unchanged.
  • Modify it — for example, redact secrets or strip disallowed content.
  • Block it — stop the run and return a message instead of calling the model.

Use input checks to keep prompt injection, secrets, and off-topic or unsafe requests out of the model.

Post (output) checks

Output guardrails run on the model’s response after generation. They can allow, modify (such as redacting sensitive text), or block the response before the user sees it. Some can also act on the response while it streams, so unsafe content is caught in real time rather than only at the end.

Strategies

Each guardrail applies one strategy when it triggers:

StrategyEffect
BlockReject the content and stop.
WarnLog a warning but let the content through.
DetectFlag the content without changing or blocking it.
RedactMask or remove the offending part and continue.

When a guardrail blocks a run, it returns a clear reason naming the rule and whether the block happened on input or output — useful for auditing and debugging.

Configuring them

Pre/post checks are set up per agent in the builder:

  1. Open the agent in the Agent Builder.
  2. Go to Capabilities → Guardrails.
  3. Apply a preset (Basic Safety, Enterprise, Customer Service, or Code Assistant) for a baseline.
  4. Expand Customize to enable individual rules and set each one’s mode (input or output) and strategy.
  5. Save the agent and test the behavior from the preview.

For the full control reference, see Guardrails.

Note: TeamMate also runs internal operational steps for things like billing and usage tracking. Those are not configurable hooks — guardrails are the before/after controls you manage.