Will be presenting a talk on 'Ontologies as Guardrails for Agentic Systems" at the AI Engineer CODE Summit in San Francisco on November 10. Guardrails sit between the agent's decision and the side effect:

  1. The agent proposes an action as structured data (JSON-LD maps cleanly to the graph).
  2. A validator such as pySHACL checks it against the shapes. No model call, no tokens.
  3. If it conforms, the action executes.
  4. If not, the validation report goes back to the agent as a tool result: which shape failed, on which field, with the human-written message. That last step matters. "Action rejected" teaches the agent nothing. "A refund must reference exactly one delivered order; order 8812 has status Shipped" gives it something to reason about.

In practice it either corrects itself or escalates to a human, which is exactly the behavior you wanted the prompt to produce.