Skip to main content
DigiTransact AI Learning Centre

Module 3 of 4

Guardrails

Input checks, output checks and the human in the loop.

Lesson 1

Input validation

Check size, format and prohibited content before the model sees it. Strip instructions smuggled inside documents.

Input checks reduce cost and abuse; they do not make the model safe on their own.

  • Limit length.
  • Detect attempts to override instructions.
  • Log blocked attempts.

Check yourself. What does length limiting protect against?

Lesson 2

Output validation

Validate structure against a schema, check required citations, scan for personal data and block unsafe content.

If validation fails, return a safe fallback rather than a half answer.

  • Schema first.
  • Check citations resolve.
  • Fail closed.

Check yourself. What should happen when the output fails validation?

Lesson 3

Approval and limits

Consequential actions need human approval. Rate limits and token caps protect both budget and availability.

Set the limits in the system, not in a policy document.

  • Approve writes.
  • Cap spend per user and per day.
  • Alert before the cap.

Check yourself. Which actions should never be fully automatic?

Lesson 4

Testing the guardrails

Attack your own system: prompt injection, data exfiltration, encoded instructions, tool misuse.

Record what got through and fix the layer that failed.

  • Red team before launch.
  • Keep a regression case for every bypass.
  • Re-test after each change.

Check yourself. What do you do with a bypass you find?