Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.
| 1 | /** |
| 2 | * LLM guardrails — appended to .md responses by getLLMText(). |
| 3 | * |
| 4 | * Pages opt into a guardrail set via frontmatter: |
| 5 | * llmGuardrails: "direct-execution" | "none" |
| 6 | * |
| 7 | * No frontmatter (default) → session guardrails. |
| 8 | */ |
| 9 | |
| 10 | import { SESSION_GUARDRAILS } from './session'; |
| 11 | import { DIRECT_EXECUTION_GUARDRAILS } from './direct-execution'; |
| 12 | |
| 13 | type GuardrailType = 'direct-execution' | 'none' | undefined; |
| 14 | |
| 15 | export function getGuardrails(type: GuardrailType): string { |
| 16 | switch (type) { |
| 17 | case 'direct-execution': |
| 18 | return DIRECT_EXECUTION_GUARDRAILS; |
| 19 | case 'none': |
| 20 | return ''; |
| 21 | default: |
| 22 | return SESSION_GUARDRAILS; |
| 23 | } |
| 24 | } |
| 25 | |
| 26 | export { SESSION_GUARDRAILS, DIRECT_EXECUTION_GUARDRAILS }; |