Deploy a Policy (API)

These are instructions for integrating your guardrails with an AI/LLM via API. If you simply want to use policies on the platform, then the next step is to create an AI Assistant.

API Guardrail Integration

  1. Within the Library click on Policies to view your private policies. In order to use a Policy, click on See Versions then select the latest or most production ready version.

  2. Under API Access, click on How to Deploy to view a popup of the API parameters for that policy.

*More detailed instructions are included in the API Reference documentation in https://api.preamble.com/docsarrow-up-right.

Example API

curl \
-X POST \
-H "X-API-Key: API_KEY_PLACHOLDER" \
-H "Content-Type: application/json" \
"https://api.preamble.com/_PLACHOLDER" \
-d '{
"policyId": "ID_PLACHOLDER",
"versionId": "ID_PLACHOLDER",
"modelId": "MODEL_PLACHOLDER", 
"applyGuardrails": 1, 
"history": [{ "role": "user", "content": "YOUR_TEXT_TO_TEST" }]
}'

Last updated