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
Within the Library click on Policies to view your private policies. In order to use a Policy, click on
See Versionsthen select the latest or most production ready version.Under API Access, click on
How to Deployto 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/docs.
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