Create a new user
| email required | string Email address of the user |
| password | string Password for the user (optional) |
| orgLevelRoleNames required | Array of strings Array of organization level role names. Valid roles: org:dynamoeval:admin, org:dynamoeval:developer, org:dynamoeval:member, org:dynamoguard:admin, org:dynamoguard:developer, org:dynamoguard:member, org:dynamoguard:extensionUser, org:dynamoguard:extensionAdmin, org:iam:admin, org:iam:editor, org:iam:viewer, org:platform:admin |
{- "email": "user@example.com",
- "password": "SecurePassword123!",
- "orgLevelRoleNames": [
- "org:dynamoeval:admin",
- "org:dynamoguard:developer",
- "org:iam:viewer"
]
}{- "email": "user@example.com",
- "temporaryPassword": "TempPassword123!",
- "keycloakId": "123e4567-e89b-12d3-a456-426614174000",
- "dynamoAIId": "507f1f77bcf86cd799439011"
}Reset the password for a user who has not completed onboarding
| email required | string Email address of the user |
| password | string New password for the user (optional) |
{- "email": "user@example.com",
- "password": "NewSecurePassword123!"
}{- "email": "user@example.com",
- "temporaryPassword": "TempPassword123!"
}Reset the password for a user who has completed onboarding
| email required | string Email address of the user |
| currentPassword required | string Current password of the user |
| newPassword required | string New password for the user |
{- "email": "user@example.com",
- "currentPassword": "CurrentPassword123!",
- "newPassword": "NewSecurePassword123!"
}Get all users with optional filtering and organization level roles
| includeOrgLevelRoles | boolean Include organization level roles in the response |
| search | string Search term to filter users |
{- "total": 100,
- "users": [
- {
- "keycloakId": "123e4567-e89b-12d3-a456-426614174000",
- "dynamoAIId": "507f1f77bcf86cd799439011",
- "email": "user@example.com",
- "firstName": "John",
- "lastName": "Doe",
- "orgLevelRoles": [
- "Admin"
], - "enabled": true
}
]
}Update the organization level roles for a user
| id required | string User ID |
| orgLevelRoles required | Array of strings Array of organization level role names. Valid roles: org:dynamoeval:admin, org:dynamoeval:developer, org:dynamoeval:member, org:dynamoguard:admin, org:dynamoguard:developer, org:dynamoguard:member, org:dynamoguard:extensionUser, org:dynamoguard:extensionAdmin, org:iam:admin, org:iam:editor, org:iam:viewer, org:platform:admin |
{- "orgLevelRoles": [
- "org:dynamoeval:admin",
- "org:dynamoguard:developer",
- "org:iam:viewer"
]
}| deploymentId required | string |
| deploymentStatus required | string Enum: "COMPLETED" "FAILED" "IN_PROGRESS" "DEPLOYMENT_DOES_NOT_EXIST" "UNKNOWN" New status of the model deployment |
| reason | string Reason of the model deployment |
{- "deploymentStatus": "COMPLETED",
- "reason": "DeploymentReady"
}| X-Num-Tokens | string Number of tokens analyzed by policies |
| Warning | string Warning displayed about tokens being not analyzed due to length |
required | Array of objects (AnalyzeMessage) OpenAI style messages with optional RAG context to analyze |
| textType required | string Enum: "MODEL_INPUT" "MODEL_RESPONSE" Whether last message is a prompt or response |
| policyIds required | Array of strings List of policies to apply |
| inheritPolicies | boolean Default: false Whether to inherit policies from the modelId passed |
| modelId | string The model id of the LLM to associate inference with |
| clientId | string The client id of the sender |
| metadata | object Metadata to be attached to the request |
{- "messages": [
- {
- "role": "user",
- "content": "string",
- "ragContext": "string"
}
], - "textType": "MODEL_INPUT",
- "policyIds": [
- "string"
], - "inheritPolicies": false,
- "modelId": "string",
- "clientId": "string",
- "metadata": { }
}{- "text": "string",
- "textType": "MODEL_INPUT",
- "finalAction": "BLOCK",
- "appliedPolicies": [
- {
- "policy": {
- "id": "string",
- "name": "string",
- "description": "string",
- "isEnabled": true,
- "method": "PII",
- "action": "BLOCK",
- "decisionParams": { },
- "language": "en",
- "applicableTo": "INPUT",
- "created_at": "2019-08-24T14:15:22Z",
- "creatorId": "string",
- "updated_at": "2019-08-24T14:15:22Z",
- "usecaseId": "string",
- "allowedBehaviors": [
- "string"
], - "disallowedBehaviors": [
- "string"
]
}, - "outputs": { },
- "action": "string"
}
], - "error": "string"
}required | Array of objects (AnalyzeMessage) OpenAI style messages with optional RAG context to analyze |
| textType required | string Enum: "MODEL_INPUT" "MODEL_RESPONSE" Whether last message is a prompt or response |
| inheritPolicies | boolean Default: false Whether to inherit policies from the modelId passed |
| modelId | string The model id of the LLM to associate inference with |
| clientId | string The client id of the sender |
| metadata | object Metadata to be attached to the request |
| domain required | string Domain of the chatbot the user is interacting with |
{- "messages": [
- {
- "role": "user",
- "content": "string",
- "ragContext": "string"
}
], - "textType": "MODEL_INPUT",
- "inheritPolicies": false,
- "modelId": "string",
- "clientId": "string",
- "metadata": { },
- "domain": "string"
}{- "text": "string",
- "textType": "MODEL_INPUT",
- "finalAction": "BLOCK",
- "appliedPolicies": [
- {
- "policy": {
- "id": "string",
- "name": "string",
- "description": "string",
- "isEnabled": true,
- "method": "PII",
- "action": "BLOCK",
- "decisionParams": { },
- "language": "en",
- "applicableTo": "INPUT",
- "created_at": "2019-08-24T14:15:22Z",
- "creatorId": "string",
- "updated_at": "2019-08-24T14:15:22Z",
- "usecaseId": "string",
- "allowedBehaviors": [
- "string"
], - "disallowedBehaviors": [
- "string"
]
}, - "outputs": { },
- "action": "string"
}
], - "error": "string"
}Retrieve logs from chat and analyze interactions. Narrow search down by using the query filters.
| modelId required | string |
| startTime | number The start time (in UTC seconds) to filter by |
| endTime | number The end time (in UTC seconds) to filter by |
| pageNum | number Default: 1 The page number |
| perPage | number Default: 50 The number of results per page |
| sortDir | string Default: "desc" Enum: "asc" "desc" The direction to sort results by. |
| policyId | string The policy id to filter by |
| policyType | string Enum: "PII" "TOXICITY" "ALIGNMENT" "HALLUCINATION" "RAG_HALLUCINATION" "INPUT_RELEVANCE" "RESPONSE_RELEVANCE" "OOB_HALLUCINATION" "KEYWORD" The policy type to filter by |
| actions | Array of strings List of actions to filter by |
| textType | string Enum: "MODEL_INPUT" "MODEL_RESPONSE" The text type to filter by |
| action | string Enum: "BLOCK" "WARN" "REDACT" "SANITIZE" "NONE" The policy action to filter by |
| clientId | string The client id to filter by |
| userId | string The user id to filter by |
| policyTypes | Array of strings List of policy types to filter by |
| metadata | string Example: metadata={origin: {platform: "chatgpt.com", browser: "Chrome"}, version: "3.16"} User-defined log metadata to filter by. Should be a json string |
{- "logs": [
- {
- "timestamp": "string",
- "analyses": [
- {
- "text": "string",
- "textType": "MODEL_INPUT",
- "appliedPolicies": [
- {
- "outputs": { },
- "violated": true,
- "feedback": { },
- "promptId": "string",
- "policy": {
- "id": "string",
- "name": "string",
- "description": "string",
- "isEnabled": true,
- "method": "PII",
- "action": "BLOCK",
- "methodParams": { },
- "decisionParams": { },
- "language": "en",
- "applicableTo": "INPUT",
- "created_at": "2019-08-24T14:15:22Z",
- "creatorId": "string",
- "updated_at": "2019-08-24T14:15:22Z",
- "usecaseId": "string",
- "allowedBehaviors": [
- "string"
], - "disallowedBehaviors": [
- "string"
]
}, - "action": "BLOCK"
}
]
}
], - "action": "BLOCK",
- "metadata": { }
}
], - "totalCount": 0,
- "warnings": [
- {
- "name": "Token Length Exceeded Warning",
- "message": "string"
}
]
}Retrieve number of log entries from chat and analyze interactions. Narrow search down by using the query filters.
| modelId required | string |
| startTime | number The start time (in UTC seconds) to filter by |
| endTime | number The end time (in UTC seconds) to filter by |
| policyId | string The policy id to filter by |
| policyType | string Enum: "PII" "TOXICITY" "ALIGNMENT" "HALLUCINATION" "RAG_HALLUCINATION" "INPUT_RELEVANCE" "RESPONSE_RELEVANCE" "OOB_HALLUCINATION" "KEYWORD" The policy type to filter by |
| actions | Array of strings List of actions to filter by |
| textType | string Enum: "MODEL_INPUT" "MODEL_RESPONSE" The text type to filter by |
| action | string Enum: "BLOCK" "WARN" "REDACT" "SANITIZE" "NONE" The policy action to filter by |
| clientId | string The client id to filter by |
| userId | string The user id to filter by |
| policyTypes | Array of strings List of policy types to filter by |
| metadata | string Example: metadata={origin: {platform: "chatgpt.com", browser: "Chrome"}, version: "3.16"} User-defined log metadata to filter by. Should be a json string |
0Retrieve logs for a specific user within a given time range. The maximum allowed time range is 1 month (30 Days).
| userEmail required | string |
| startTime required | number |
| endTime required | number |
| sortDir required | string |
{- "presignedUrl": "string",
- "logCount": 0
}Retrieve dashboard metrics. Narrow search down by using the query filters. At least one of modelId, clientId, or userId must be specified.
| modelId required | string |
| startTime | number The start time to filter by |
| endTime | number The end time to filter by |
| numDataPoints | number Default: 2 Number of data points to discretize time period. Must be greater than 1. |
| clientId | string The client id to filter by |
{- "overview": {
- "MODEL_INPUT": {
- "total": [
- 0
], - "flagged": [
- 0
]
}, - "MODEL_RESPONSE": {
- "total": [
- 0
], - "flagged": [
- 0
]
}
}, - "privacy": {
- "MODEL_INPUT": {
- "entity_types": {
- "LOCATION": [
- 0,
- 37
]
}, - "total": [
- 0
]
}, - "MODEL_RESPONSE": {
- "entity_types": {
- "LOCATION": [
- 0,
- 37
]
}, - "total": [
- 0
]
}
}, - "keyword": {
- "MODEL_INPUT": {
- "entity_types": {
- "lawyer": [
- 0,
- 37
]
}, - "total": [
- 0
]
}, - "MODEL_RESPONSE": {
- "entity_types": {
- "lawyer": [
- 0,
- 37
]
}, - "total": [
- 0
]
}
}, - "toxicity": {
- "MODEL_INPUT": {
- "total": [
- 0
], - "violation_rate": {
- "value": 0,
- "data": [
- 0
]
}
}, - "MODEL_RESPONSE": {
- "total": [
- 0
], - "violation_rate": {
- "value": 0,
- "data": [
- 0
]
}
}
}, - "alignment": {
- "MODEL_INPUT": {
- "total": [
- 0
], - "policies": {
- "property1": {
- "name": "string",
- "num_violations": [
- 0
], - "violation_rate": {
- "value": 0,
- "data": [
- 0
]
}
}, - "property2": {
- "name": "string",
- "num_violations": [
- 0
], - "violation_rate": {
- "value": 0,
- "data": [
- 0
]
}
}
}
}, - "MODEL_RESPONSE": {
- "total": [
- 0
], - "policies": {
- "property1": {
- "name": "string",
- "num_violations": [
- 0
], - "violation_rate": {
- "value": 0,
- "data": [
- 0
]
}
}, - "property2": {
- "name": "string",
- "num_violations": [
- 0
], - "violation_rate": {
- "value": 0,
- "data": [
- 0
]
}
}
}
}
}, - "hallucination": {
- "MODEL_RESPONSE": {
- "total": [
- 0
], - "violation_rate": {
- "value": 0,
- "data": [
- 0
]
}, - "average": {
- "value": 0,
- "data": [
- 0
]
}
}
}, - "inputRelevance": {
- "MODEL_INPUT": {
- "entries": {
- "value": 0,
- "data": [
- 0
]
}, - "violations": {
- "value": 0,
- "data": [
- 0
]
}, - "violation_rate": {
- "value": 0,
- "data": [
- 0
]
}
}
}, - "responseRelevance": {
- "MODEL_RESPONSE": {
- "entries": {
- "value": 0,
- "data": [
- 0
]
}, - "violations": {
- "value": 0,
- "data": [
- 0
]
}, - "contextRelevance": {
- "violations": {
- "value": 0,
- "data": [
- 0
]
}, - "violation_rate": {
- "value": 0,
- "data": [
- 0
]
}
}, - "responseRelevance": {
- "violations": {
- "value": 0,
- "data": [
- 0
]
}, - "violation_rate": {
- "value": 0,
- "data": [
- 0
]
}
}
}
}, - "latency": {
- "e2eLatency": {
- "percentile50": {
- "value": 0,
- "data": [
- 0
]
}, - "percentile90": {
- "value": 0,
- "data": [
- 0
]
}, - "percentile99": {
- "value": 0,
- "data": [
- 0
]
}
}, - "inputGuardrailLatency": {
- "percentile50": {
- "value": 0,
- "data": [
- 0
]
}, - "percentile90": {
- "value": 0,
- "data": [
- 0
]
}, - "percentile99": {
- "value": 0,
- "data": [
- 0
]
}
}, - "outputGuardrailLatency": {
- "percentile50": {
- "value": 0,
- "data": [
- 0
]
}, - "percentile90": {
- "value": 0,
- "data": [
- 0
]
}, - "percentile99": {
- "value": 0,
- "data": [
- 0
]
}
}, - "llmCompletionLatency": {
- "percentile50": {
- "value": 0,
- "data": [
- 0
]
}, - "percentile90": {
- "value": 0,
- "data": [
- 0
]
}, - "percentile99": {
- "value": 0,
- "data": [
- 0
]
}
}, - "requests": {
- "successful": {
- "value": 0,
- "data": [
- 0
]
}, - "failed": {
- "value": 0,
- "data": [
- 0
]
}
}, - "failureTypes": {
- "http4xx": {
- "value": 0,
- "data": [
- 0
]
}, - "http5xx": {
- "value": 0,
- "data": [
- 0
]
}
}
}, - "timestamps": [
- 0
], - "rules": {
- "ruleViolations": 0,
- "rulesActive": 0
}
}Apply policies to messages and send non-violating prompts to LLM. Routes messages to the LLM behind modelId. Blocks/modifies prompt/response as policies dictate
| modelId required | string |
| session_id required | string Session id to link chat messages to |
| X-Num-Tokens | string Number of tokens analyzed by policies |
| Warning | string Warning displayed about tokens being not analyzed due to length |
| clientId | string The client id of the sender |
required | Array of objects (ChatMessage) OpenAI style messages to send to the LLM |
| metadata | object Metadata to be attached to the request |
| overridePolicyIds | Array of strings Explicit list of policies to apply instead of the ones attached to the model |
{- "clientId": "string",
- "messages": [
- {
- "role": "user",
- "content": "string"
}
], - "metadata": { },
- "overridePolicyIds": [
- "string"
]
}{- "source": {
- "user": "string",
- "session": "string",
- "model": "string",
- "client": "string"
}, - "chat": {
- "queryId": "string",
- "prompt": "string",
- "preprocessedPrompt": "string",
- "response": "string",
- "desanitizedResponse": "string",
- "postprocessedResponse": "string",
- "ragContext": "string",
- "error": "string"
}, - "metadata": { },
- "analyses": [
- {
- "text": "string",
- "textType": "MODEL_INPUT",
- "finalAction": "BLOCK",
- "appliedPolicies": [
- {
- "policy": {
- "id": "string",
- "name": "string",
- "description": "string",
- "isEnabled": true,
- "method": "PII",
- "action": "BLOCK",
- "decisionParams": { },
- "language": "en",
- "applicableTo": "INPUT",
- "created_at": "2019-08-24T14:15:22Z",
- "creatorId": "string",
- "updated_at": "2019-08-24T14:15:22Z",
- "usecaseId": "string",
- "allowedBehaviors": [
- "string"
], - "disallowedBehaviors": [
- "string"
]
}, - "outputs": { },
- "action": "string"
}
], - "error": "string"
}
], - "usage": {
- "inputGuardrailTokens": 0,
- "outputGuardrailTokens": 0,
- "totalGuardrailTokens": 0
}, - "warnings": [
- {
- "name": "Token Length Exceeded Warning",
- "message": "string"
}
]
}| id required | string |
| policyIds required | Array of strings List of policy ids to activate on the model |
| action required | string Enum: "ADD" "REMOVE" "REPLACE" Operation to perform on models |
{- "policyIds": [
- "string"
], - "action": "ADD"
}Creates a policy on DynamoGuard. Each policy uses methodParams as arguments for the underlying policy and decisionParams to determine the action to take based on the policy result.
| name required | string Name of the policy |
| description | string Description of the policy |
| method required | string Enum: "PII" "TOXICITY" "ALIGNMENT" "HALLUCINATION" "RAG_HALLUCINATION" "INPUT_RELEVANCE" "RESPONSE_RELEVANCE" "OOB_HALLUCINATION" "KEYWORD" Type of policy |
| action required | string Default: "NONE" Enum: "BLOCK" "WARN" "REDACT" "SANITIZE" "NONE" The action to take if the policy is violated |
| methodParams required | object The arguments for the policy. These differ depending on the policy type |
| decisionParams required | object The parameters for determining the policy action from outputs. These differ depending on the policy type |
| applicableTo required | string Default: "ALL" Enum: "INPUT" "OUTPUT" "ALL" Which type of message the policy should apply to |
| language | string Default: "en" Enum: "en" "ja" Language of the policy (ISO 639-1 code) |
{- "name": "string",
- "description": "string",
- "method": "PII",
- "action": "BLOCK",
- "methodParams": { },
- "decisionParams": { },
- "applicableTo": "INPUT",
- "language": "en"
}{- "id": "string",
- "name": "string",
- "description": "string",
- "isEnabled": true,
- "method": "PII",
- "action": "BLOCK",
- "methodParams": { },
- "decisionParams": { },
- "language": "en",
- "applicableTo": "INPUT",
- "created_at": "2019-08-24T14:15:22Z",
- "creatorId": "string",
- "updated_at": "2019-08-24T14:15:22Z",
- "usecaseId": "string",
- "allowedBehaviors": [
- "string"
], - "disallowedBehaviors": [
- "string"
]
}Retrieves all policies a user made. If modelId is specified, attaches policy statuses as well
| policyType | string Enum: "PII" "TOXICITY" "ALIGNMENT" "HALLUCINATION" "RAG_HALLUCINATION" "INPUT_RELEVANCE" "RESPONSE_RELEVANCE" "OOB_HALLUCINATION" "KEYWORD" Policy type to filter on |
| modelId | string If specified, attaches policy status in relation to the modelId |
| expand | boolean If true, attaches dataset info. Only available for content policies |
| attachModels | boolean If specified, attaches models policy is applied to |
| inferred | boolean If true, returns inferred policy fields instead of the original policy |
| filterDeprecatedPolicies | boolean If true, filters out deprecated policies |
| page required | number |
| limit required | number |
| includeAllowedScopes required | boolean |
{- "total": 0,
- "policies": [
- {
- "id": "string",
- "name": "string",
- "description": "string",
- "isEnabled": true,
- "method": "PII",
- "action": "BLOCK",
- "methodParams": { },
- "decisionParams": { },
- "language": "en",
- "applicableTo": "INPUT",
- "created_at": "2019-08-24T14:15:22Z",
- "creatorId": "string",
- "updated_at": "2019-08-24T14:15:22Z",
- "usecaseId": "string",
- "allowedBehaviors": [
- "string"
], - "disallowedBehaviors": [
- "string"
], - "stage": "seed",
- "feedback": {
- "promptId": "string",
- "review": {
- "prompt": "string",
- "isCompliant": true,
- "feedback": true
}, - "createdAt": "2019-08-24T14:15:22Z",
- "creator": "string"
}, - "trainingStatus": "CREATING",
- "appliedStatus": "IN_DEVELOPMENT",
- "resourceDeploymentStatus": "DEPLOYED",
- "trainingStatusDetails": {
- "jobId": "string",
- "progress": {
- "percentage": 0,
- "totalNoOfItems": 0,
- "noOfItemsProcessed": 0
}, - "lastProgress": {
- "percentage": 0,
- "totalNoOfItems": 0,
- "noOfItemsProcessed": 0
}, - "queuedForTooLong": true,
- "wasResumed": true,
- "failure": {
- "type": "INTERNAL_SERVER_ERROR",
- "message": "string"
}, - "totalElapsedTime": 0
}, - "latestJobStat": { },
- "models": [
- "string"
], - "creator": {
- "id": "string",
- "email": "string"
}
}
]
}Updates only the inferred policy fields for ALIGNMENT type policies.
| id required | string Policy id to update |
| name required | string Name of the policy |
| description required | string Description of the policy |
| allowedBehaviors required | Array of strings List of allowed behaviors for the policy |
| disallowedBehaviors required | Array of strings List of disallowed behaviors for the policy |
{- "name": "string",
- "description": "string",
- "allowedBehaviors": [
- "Provide factual information",
- "Answer general knowledge questions"
], - "disallowedBehaviors": [
- "Share personal opinions",
- "Provide medical advice"
]
}{- "id": "string",
- "name": "string",
- "description": "string",
- "isEnabled": true,
- "method": "PII",
- "action": "BLOCK",
- "methodParams": { },
- "decisionParams": { },
- "language": "en",
- "applicableTo": "INPUT",
- "created_at": "2019-08-24T14:15:22Z",
- "creatorId": "string",
- "updated_at": "2019-08-24T14:15:22Z",
- "usecaseId": "string",
- "allowedBehaviors": [
- "string"
], - "disallowedBehaviors": [
- "string"
]
}Updates the base policy fields for all types of policies. Also updates the inferred policy fields for ALIGNMENT type policies.
| id required | string Policy id to update |
| name | string Name of the policy |
| description | string Description of the policy |
| action | string Enum: "BLOCK" "WARN" "REDACT" "SANITIZE" "NONE" The action to take if the policy is violated |
| methodParams | object The arguments for the policy. These differ depending on the policy type |
| decisionParams | object The parameters for determining the policy action from outputs. These differ depending on the policy type |
| applicableTo | string Enum: "INPUT" "OUTPUT" "ALL" Which type of message the policy should apply to |
| language | string Enum: "en" "ja" Language of the policy (ISO 639-1 code) |
| isEnabled | boolean Default: true Whether the policy is enabled or disabled |
{- "name": "string",
- "description": "string",
- "action": "BLOCK",
- "methodParams": { },
- "decisionParams": { },
- "applicableTo": "INPUT",
- "language": "en",
- "isEnabled": true
}{- "id": "string",
- "name": "string",
- "description": "string",
- "isEnabled": true,
- "method": "PII",
- "action": "BLOCK",
- "methodParams": { },
- "decisionParams": { },
- "language": "en",
- "applicableTo": "INPUT",
- "created_at": "2019-08-24T14:15:22Z",
- "creatorId": "string",
- "updated_at": "2019-08-24T14:15:22Z",
- "usecaseId": "string",
- "allowedBehaviors": [
- "string"
], - "disallowedBehaviors": [
- "string"
]
}Use query params to add additional information
| id required | string Policy id to retrieve |
| expand | boolean If true, attaches dataset info. Only available for content policies |
| modelId | string If specified, attaches policy status in reference to the given model. Also filters policy stats. |
| promptId | string If specified, attaches feedback for the prompt |
| attachModels | boolean If specified, attaches models policy is applied to |
| inferred | boolean If true, returns inferred policy fields instead of the orignal policy |
{- "id": "string",
- "name": "string",
- "description": "string",
- "isEnabled": true,
- "method": "PII",
- "action": "BLOCK",
- "methodParams": { },
- "decisionParams": { },
- "language": "en",
- "applicableTo": "INPUT",
- "created_at": "2019-08-24T14:15:22Z",
- "creatorId": "string",
- "updated_at": "2019-08-24T14:15:22Z",
- "usecaseId": "string",
- "allowedBehaviors": [
- "string"
], - "disallowedBehaviors": [
- "string"
], - "stage": "seed",
- "feedback": {
- "promptId": "string",
- "review": {
- "prompt": "string",
- "isCompliant": true,
- "feedback": true
}, - "createdAt": "2019-08-24T14:15:22Z",
- "creator": "string"
}, - "trainingStatus": "CREATING",
- "appliedStatus": "IN_DEVELOPMENT",
- "resourceDeploymentStatus": "DEPLOYED",
- "trainingStatusDetails": {
- "jobId": "string",
- "progress": {
- "percentage": 0,
- "totalNoOfItems": 0,
- "noOfItemsProcessed": 0
}, - "lastProgress": {
- "percentage": 0,
- "totalNoOfItems": 0,
- "noOfItemsProcessed": 0
}, - "queuedForTooLong": true,
- "wasResumed": true,
- "failure": {
- "type": "INTERNAL_SERVER_ERROR",
- "message": "string"
}, - "totalElapsedTime": 0
}, - "latestJobStat": { },
- "models": [
- "string"
]
}Appends allowed and disallowed behaviors to an existing alignment policy
| id required | string Policy id to add behaviors to |
| allowedBehaviors | Array of strings Additional allowed behaviors to add to the policy |
| disallowedBehaviors | Array of strings Additional disallowed behaviors to add to the policy |
{- "allowedBehaviors": [
- "Provide factual information",
- "Answer general knowledge questions"
], - "disallowedBehaviors": [
- "Share personal opinions",
- "Provide medical advice"
]
}{- "id": "string",
- "name": "string",
- "description": "string",
- "isEnabled": true,
- "method": "PII",
- "action": "BLOCK",
- "methodParams": { },
- "decisionParams": { },
- "language": "en",
- "applicableTo": "INPUT",
- "created_at": "2019-08-24T14:15:22Z",
- "creatorId": "string",
- "updated_at": "2019-08-24T14:15:22Z",
- "usecaseId": "string",
- "allowedBehaviors": [
- "string"
], - "disallowedBehaviors": [
- "string"
]
}| id required | string |
| modelIds required | Array of strings List of model ids to add/remove policy to |
| action required | string Enum: "ADD" "REMOVE" "REPLACE" Operation to perform on models |
{- "modelIds": [
- "string"
], - "action": "ADD"
}Adds or updates decision parameters for a policy, starting with threshold configuration
| id required | string Policy id to update decision parameters |
| classification_threshold required | number [ 0 .. 1 ] Classification threshold value between 0 and 1 |
{- "classification_threshold": 1
}Updates the configuration of a guardrail dataset
| policyId required | string ID of the policy to update dataset for |
| stage | string Stage of the guardrail dataset |
Array of objects (UpdateGuardrailDatapointDto) Array of datapoints for the guardrail dataset | |
| bestTemperature | number Best temperature determined so far |
| bestInstruction | string Best instruction determined so far |
{- "stage": "REVIEW",
- "dataset": [
- {
- "id": "datapoint_123",
- "round": 2,
- "generated": {
- "response": "Factory design pattern is a creational pattern...",
- "isCompliant": true,
- "prompt": "Can you please tell me what factory design pattern is?",
- "rationale": "Prompt is asking for a design pattern explanation, which is safe.",
- "trickiness": "in_domain",
- "relevantBehaviors": [
- "Can talk about design principles"
], - "violatedCategoriesResolutionCodes": [
- "category_123"
], - "policyAnalysisRationale": "This response is safe"
}, - "review": {
- "prompt": "Can you please tell me what factory design pattern is?",
- "isCompliant": true,
- "isAccepted": true,
- "feedback": "Prompt is asking for a design pattern explanation and the response answers it, which is safe.",
- "response": "Factory design pattern is a creational pattern..."
}, - "creatorType": "generated",
- "creatorId": "507f1f77bcf86cd799439011"
}
], - "bestTemperature": 0.7,
- "bestInstruction": "You are an expert in providing helpful responses..."
}Retrieves a guardrail dataset and all its metadata by policy ID
| policyId required | string ID of the policy to get dataset for |
| page | number Default: 1 Page number for pagination (starting from 1) |
| limit | number Default: 300 Number of items per page. Takes default value of 300 if not specified. Maximum limit is 500 |
| includeDataset | boolean Default: true Whether to include the dataset in the response |
| populateCreatorEmails | boolean Default: true Whether to populate creator emails in the response |
{- "policyId": "policy_12345",
- "creator": "admin",
- "allowedBehaviors": [
- "Can talk about design principles",
- "Can talk about generic programming questions"
], - "disallowedBehaviors": [
- "Cannot talk abouttax advise",
- "Cannot talk about investment advise"
], - "stage": "seed",
- "currentRound": 2,
- "dataset": [
- {
- "id": "dp_123",
- "round": 1,
- "generated": {
- "response": "Factory design pattern is a creational pattern...",
- "isCompliant": true,
- "prompt": "Can you please tell me what factory design pattern is?",
- "rationale": "Prompt is asking for a design pattern explanation, which is safe.",
- "trickiness": "in_domain",
- "relevantBehaviors": [
- "Can talk about design principles"
], - "violatedCategoriesResolutionCodes": [
- "category_123"
], - "policyAnalysisRationale": "This response is safe"
}, - "review": {
- "prompt": "Can you please tell me what factory design pattern is?",
- "isCompliant": true,
- "isAccepted": true,
- "feedback": "Prompt is asking for a design pattern explanation and the response answers it, which is safe.",
- "response": "Factory design pattern is a creational pattern..."
}, - "creatorType": "user",
- "creatorId": "user_abc",
- "createdAt": "2024-03-14T12:00:00Z",
- "updatedAt": "2024-03-14T12:00:00Z"
}
], - "datasetPageDetails": {
- "page": 1,
- "limit": 100,
- "totalPages": 28,
- "totalItems": 2750
}, - "feedback": [
- {
- "_id": "507f1f77bcf86cd799439011",
- "promptId": "prompt_123",
- "generated": {
- "response": "Factory design pattern is a creational pattern...",
- "isCompliant": true,
- "prompt": "Can you please tell me what factory design pattern is?",
- "rationale": "Prompt is asking for a design pattern explanation, which is safe.",
- "trickiness": "in_domain",
- "relevantBehaviors": [
- "Can talk about design principles"
], - "violatedCategoriesResolutionCodes": [
- "category_123"
], - "policyAnalysisRationale": "This response is safe"
}, - "review": {
- "prompt": "Can you please tell me what factory design pattern is?",
- "isCompliant": true,
- "isAccepted": true,
- "feedback": "Prompt is asking for a design pattern explanation and the response answers it, which is safe.",
- "response": "Factory design pattern is a creational pattern..."
}, - "creatorType": "user",
- "creator": "507f1f77bcf86cd799439012",
- "createdAt": "2024-03-14T12:00:00Z",
- "updatedAt": "2024-03-14T12:00:00Z"
}
], - "version": 3,
- "bestTemperature": 0.8,
- "bestInstruction": "You are an expert in providing helpful responses...",
- "created_at": "2024-03-14T12:00:00Z",
- "updated_at": "2024-03-14T12:00:00Z"
}Creates a new input guardrail dataset for a policy
| policyId required | string ID of the policy to create dataset for |
| allowedBehaviors | Array of strings An array of allowed behaviors |
| disallowedBehaviors | Array of strings An array of disallowed behaviors |
| manualCreation required | boolean Indicates whether this dataset was manually created |
{- "allowedBehaviors": [
- "Can talk about generic programming questions.",
- "Can talk about design principles."
], - "disallowedBehaviors": [
- "Cannot talk about tax advise.",
- "Cannot talk about investment advise."
], - "manualCreation": false
}{- "policyId": "policy_12345",
- "creator": "admin",
- "allowedBehaviors": [
- "Can talk about design principles",
- "Can talk about generic programming questions"
], - "disallowedBehaviors": [
- "Cannot talk abouttax advise",
- "Cannot talk about investment advise"
], - "stage": "seed",
- "currentRound": 2,
- "dataset": [
- {
- "id": "dp_123",
- "round": 1,
- "generated": {
- "response": "Factory design pattern is a creational pattern...",
- "isCompliant": true,
- "prompt": "Can you please tell me what factory design pattern is?",
- "rationale": "Prompt is asking for a design pattern explanation, which is safe.",
- "trickiness": "in_domain",
- "relevantBehaviors": [
- "Can talk about design principles"
], - "violatedCategoriesResolutionCodes": [
- "category_123"
], - "policyAnalysisRationale": "This response is safe"
}, - "review": {
- "prompt": "Can you please tell me what factory design pattern is?",
- "isCompliant": true,
- "isAccepted": true,
- "feedback": "Prompt is asking for a design pattern explanation and the response answers it, which is safe.",
- "response": "Factory design pattern is a creational pattern..."
}, - "creatorType": "user",
- "creatorId": "user_abc",
- "createdAt": "2024-03-14T12:00:00Z",
- "updatedAt": "2024-03-14T12:00:00Z"
}
], - "datasetPageDetails": {
- "page": 1,
- "limit": 100,
- "totalPages": 28,
- "totalItems": 2750
}, - "feedback": [
- {
- "_id": "507f1f77bcf86cd799439011",
- "promptId": "prompt_123",
- "generated": {
- "response": "Factory design pattern is a creational pattern...",
- "isCompliant": true,
- "prompt": "Can you please tell me what factory design pattern is?",
- "rationale": "Prompt is asking for a design pattern explanation, which is safe.",
- "trickiness": "in_domain",
- "relevantBehaviors": [
- "Can talk about design principles"
], - "violatedCategoriesResolutionCodes": [
- "category_123"
], - "policyAnalysisRationale": "This response is safe"
}, - "review": {
- "prompt": "Can you please tell me what factory design pattern is?",
- "isCompliant": true,
- "isAccepted": true,
- "feedback": "Prompt is asking for a design pattern explanation and the response answers it, which is safe.",
- "response": "Factory design pattern is a creational pattern..."
}, - "creatorType": "user",
- "creator": "507f1f77bcf86cd799439012",
- "createdAt": "2024-03-14T12:00:00Z",
- "updatedAt": "2024-03-14T12:00:00Z"
}
], - "version": 3,
- "bestTemperature": 0.8,
- "bestInstruction": "You are an expert in providing helpful responses...",
- "created_at": "2024-03-14T12:00:00Z",
- "updated_at": "2024-03-14T12:00:00Z"
}Creates a new output guardrail dataset for a policy
| policyId required | string ID of the policy to create dataset for |
| allowedBehaviors | Array of strings An array of allowed behaviors |
| disallowedBehaviors | Array of strings An array of disallowed behaviors |
| manualCreation required | boolean Indicates whether this dataset was manually created |
{- "allowedBehaviors": [
- "Can talk about generic programming questions.",
- "Can talk about design principles."
], - "disallowedBehaviors": [
- "Cannot talk about tax advise.",
- "Cannot talk about investment advise."
], - "manualCreation": false
}{- "policyId": "policy_12345",
- "creator": "admin",
- "allowedBehaviors": [
- "Can talk about design principles",
- "Can talk about generic programming questions"
], - "disallowedBehaviors": [
- "Cannot talk abouttax advise",
- "Cannot talk about investment advise"
], - "stage": "seed",
- "currentRound": 2,
- "dataset": [
- {
- "id": "dp_123",
- "round": 1,
- "generated": {
- "response": "Factory design pattern is a creational pattern...",
- "isCompliant": true,
- "prompt": "Can you please tell me what factory design pattern is?",
- "rationale": "Prompt is asking for a design pattern explanation, which is safe.",
- "trickiness": "in_domain",
- "relevantBehaviors": [
- "Can talk about design principles"
], - "violatedCategoriesResolutionCodes": [
- "category_123"
], - "policyAnalysisRationale": "This response is safe"
}, - "review": {
- "prompt": "Can you please tell me what factory design pattern is?",
- "isCompliant": true,
- "isAccepted": true,
- "feedback": "Prompt is asking for a design pattern explanation and the response answers it, which is safe.",
- "response": "Factory design pattern is a creational pattern..."
}, - "creatorType": "user",
- "creatorId": "user_abc",
- "createdAt": "2024-03-14T12:00:00Z",
- "updatedAt": "2024-03-14T12:00:00Z"
}
], - "datasetPageDetails": {
- "page": 1,
- "limit": 100,
- "totalPages": 28,
- "totalItems": 2750
}, - "feedback": [
- {
- "_id": "507f1f77bcf86cd799439011",
- "promptId": "prompt_123",
- "generated": {
- "response": "Factory design pattern is a creational pattern...",
- "isCompliant": true,
- "prompt": "Can you please tell me what factory design pattern is?",
- "rationale": "Prompt is asking for a design pattern explanation, which is safe.",
- "trickiness": "in_domain",
- "relevantBehaviors": [
- "Can talk about design principles"
], - "violatedCategoriesResolutionCodes": [
- "category_123"
], - "policyAnalysisRationale": "This response is safe"
}, - "review": {
- "prompt": "Can you please tell me what factory design pattern is?",
- "isCompliant": true,
- "isAccepted": true,
- "feedback": "Prompt is asking for a design pattern explanation and the response answers it, which is safe.",
- "response": "Factory design pattern is a creational pattern..."
}, - "creatorType": "user",
- "creator": "507f1f77bcf86cd799439012",
- "createdAt": "2024-03-14T12:00:00Z",
- "updatedAt": "2024-03-14T12:00:00Z"
}
], - "version": 3,
- "bestTemperature": 0.8,
- "bestInstruction": "You are an expert in providing helpful responses...",
- "created_at": "2024-03-14T12:00:00Z",
- "updated_at": "2024-03-14T12:00:00Z"
}Reviews and updates an input guardrail dataset
| policyId required | string ID of the policy to review dataset for |
required | Array of objects (ReviewedInputGuardrailDataset) Array of reviewed guardrail datapoints for input | ||||||||||
Array
| |||||||||||
{- "reviewedDataset": [
- {
- "isAccepted": true,
- "prompt": "Can you please tell me what factory design pattern is?",
- "isCompliant": true,
- "feedback": "The prompt seems compliant and safe for our guardrail.",
- "id": "abc123"
}
]
}{- "policyId": "policy_12345",
- "creator": "admin",
- "allowedBehaviors": [
- "Can talk about design principles",
- "Can talk about generic programming questions"
], - "disallowedBehaviors": [
- "Cannot talk abouttax advise",
- "Cannot talk about investment advise"
], - "stage": "seed",
- "currentRound": 2,
- "dataset": [
- {
- "id": "dp_123",
- "round": 1,
- "generated": {
- "response": "Factory design pattern is a creational pattern...",
- "isCompliant": true,
- "prompt": "Can you please tell me what factory design pattern is?",
- "rationale": "Prompt is asking for a design pattern explanation, which is safe.",
- "trickiness": "in_domain",
- "relevantBehaviors": [
- "Can talk about design principles"
], - "violatedCategoriesResolutionCodes": [
- "category_123"
], - "policyAnalysisRationale": "This response is safe"
}, - "review": {
- "prompt": "Can you please tell me what factory design pattern is?",
- "isCompliant": true,
- "isAccepted": true,
- "feedback": "Prompt is asking for a design pattern explanation and the response answers it, which is safe.",
- "response": "Factory design pattern is a creational pattern..."
}, - "creatorType": "user",
- "creatorId": "user_abc",
- "createdAt": "2024-03-14T12:00:00Z",
- "updatedAt": "2024-03-14T12:00:00Z"
}
], - "datasetPageDetails": {
- "page": 1,
- "limit": 100,
- "totalPages": 28,
- "totalItems": 2750
}, - "feedback": [
- {
- "_id": "507f1f77bcf86cd799439011",
- "promptId": "prompt_123",
- "generated": {
- "response": "Factory design pattern is a creational pattern...",
- "isCompliant": true,
- "prompt": "Can you please tell me what factory design pattern is?",
- "rationale": "Prompt is asking for a design pattern explanation, which is safe.",
- "trickiness": "in_domain",
- "relevantBehaviors": [
- "Can talk about design principles"
], - "violatedCategoriesResolutionCodes": [
- "category_123"
], - "policyAnalysisRationale": "This response is safe"
}, - "review": {
- "prompt": "Can you please tell me what factory design pattern is?",
- "isCompliant": true,
- "isAccepted": true,
- "feedback": "Prompt is asking for a design pattern explanation and the response answers it, which is safe.",
- "response": "Factory design pattern is a creational pattern..."
}, - "creatorType": "user",
- "creator": "507f1f77bcf86cd799439012",
- "createdAt": "2024-03-14T12:00:00Z",
- "updatedAt": "2024-03-14T12:00:00Z"
}
], - "version": 3,
- "bestTemperature": 0.8,
- "bestInstruction": "You are an expert in providing helpful responses...",
- "created_at": "2024-03-14T12:00:00Z",
- "updated_at": "2024-03-14T12:00:00Z"
}Reviews and updates an output guardrail dataset
| policyId required | string ID of the policy to review dataset for |
required | Array of objects (ReviewedOutputGuardrailDataset) Array of reviewed guardrail datapoints for output | ||||||||||||||||||
Array
| |||||||||||||||||||
{- "reviewedDataset": [
- {
- "isAccepted": true,
- "prompt": "Can you please tell me what factory design pattern is?",
- "isCompliant": true,
- "feedback": "The prompt seems compliant and safe for our guardrail.",
- "id": "def456",
- "response": "42 is the meaning of life.",
- "userName": "Alice",
- "userId": "user_12345",
- "updateTime": "2024-03-14T12:00:00Z"
}
]
}{- "policyId": "policy_12345",
- "creator": "admin",
- "allowedBehaviors": [
- "Can talk about design principles",
- "Can talk about generic programming questions"
], - "disallowedBehaviors": [
- "Cannot talk abouttax advise",
- "Cannot talk about investment advise"
], - "stage": "seed",
- "currentRound": 2,
- "dataset": [
- {
- "id": "dp_123",
- "round": 1,
- "generated": {
- "response": "Factory design pattern is a creational pattern...",
- "isCompliant": true,
- "prompt": "Can you please tell me what factory design pattern is?",
- "rationale": "Prompt is asking for a design pattern explanation, which is safe.",
- "trickiness": "in_domain",
- "relevantBehaviors": [
- "Can talk about design principles"
], - "violatedCategoriesResolutionCodes": [
- "category_123"
], - "policyAnalysisRationale": "This response is safe"
}, - "review": {
- "prompt": "Can you please tell me what factory design pattern is?",
- "isCompliant": true,
- "isAccepted": true,
- "feedback": "Prompt is asking for a design pattern explanation and the response answers it, which is safe.",
- "response": "Factory design pattern is a creational pattern..."
}, - "creatorType": "user",
- "creatorId": "user_abc",
- "createdAt": "2024-03-14T12:00:00Z",
- "updatedAt": "2024-03-14T12:00:00Z"
}
], - "datasetPageDetails": {
- "page": 1,
- "limit": 100,
- "totalPages": 28,
- "totalItems": 2750
}, - "feedback": [
- {
- "_id": "507f1f77bcf86cd799439011",
- "promptId": "prompt_123",
- "generated": {
- "response": "Factory design pattern is a creational pattern...",
- "isCompliant": true,
- "prompt": "Can you please tell me what factory design pattern is?",
- "rationale": "Prompt is asking for a design pattern explanation, which is safe.",
- "trickiness": "in_domain",
- "relevantBehaviors": [
- "Can talk about design principles"
], - "violatedCategoriesResolutionCodes": [
- "category_123"
], - "policyAnalysisRationale": "This response is safe"
}, - "review": {
- "prompt": "Can you please tell me what factory design pattern is?",
- "isCompliant": true,
- "isAccepted": true,
- "feedback": "Prompt is asking for a design pattern explanation and the response answers it, which is safe.",
- "response": "Factory design pattern is a creational pattern..."
}, - "creatorType": "user",
- "creator": "507f1f77bcf86cd799439012",
- "createdAt": "2024-03-14T12:00:00Z",
- "updatedAt": "2024-03-14T12:00:00Z"
}
], - "version": 3,
- "bestTemperature": 0.8,
- "bestInstruction": "You are an expert in providing helpful responses...",
- "created_at": "2024-03-14T12:00:00Z",
- "updated_at": "2024-03-14T12:00:00Z"
}Provides feedback on a guardrail dataset
| policyId required | string ID of the policy to provide feedback for |
{- "policyId": "policy_12345",
- "creator": "admin",
- "allowedBehaviors": [
- "Can talk about design principles",
- "Can talk about generic programming questions"
], - "disallowedBehaviors": [
- "Cannot talk abouttax advise",
- "Cannot talk about investment advise"
], - "stage": "seed",
- "currentRound": 2,
- "dataset": [
- {
- "id": "dp_123",
- "round": 1,
- "generated": {
- "response": "Factory design pattern is a creational pattern...",
- "isCompliant": true,
- "prompt": "Can you please tell me what factory design pattern is?",
- "rationale": "Prompt is asking for a design pattern explanation, which is safe.",
- "trickiness": "in_domain",
- "relevantBehaviors": [
- "Can talk about design principles"
], - "violatedCategoriesResolutionCodes": [
- "category_123"
], - "policyAnalysisRationale": "This response is safe"
}, - "review": {
- "prompt": "Can you please tell me what factory design pattern is?",
- "isCompliant": true,
- "isAccepted": true,
- "feedback": "Prompt is asking for a design pattern explanation and the response answers it, which is safe.",
- "response": "Factory design pattern is a creational pattern..."
}, - "creatorType": "user",
- "creatorId": "user_abc",
- "createdAt": "2024-03-14T12:00:00Z",
- "updatedAt": "2024-03-14T12:00:00Z"
}
], - "datasetPageDetails": {
- "page": 1,
- "limit": 100,
- "totalPages": 28,
- "totalItems": 2750
}, - "feedback": [
- {
- "_id": "507f1f77bcf86cd799439011",
- "promptId": "prompt_123",
- "generated": {
- "response": "Factory design pattern is a creational pattern...",
- "isCompliant": true,
- "prompt": "Can you please tell me what factory design pattern is?",
- "rationale": "Prompt is asking for a design pattern explanation, which is safe.",
- "trickiness": "in_domain",
- "relevantBehaviors": [
- "Can talk about design principles"
], - "violatedCategoriesResolutionCodes": [
- "category_123"
], - "policyAnalysisRationale": "This response is safe"
}, - "review": {
- "prompt": "Can you please tell me what factory design pattern is?",
- "isCompliant": true,
- "isAccepted": true,
- "feedback": "Prompt is asking for a design pattern explanation and the response answers it, which is safe.",
- "response": "Factory design pattern is a creational pattern..."
}, - "creatorType": "user",
- "creator": "507f1f77bcf86cd799439012",
- "createdAt": "2024-03-14T12:00:00Z",
- "updatedAt": "2024-03-14T12:00:00Z"
}
], - "version": 3,
- "bestTemperature": 0.8,
- "bestInstruction": "You are an expert in providing helpful responses...",
- "created_at": "2024-03-14T12:00:00Z",
- "updated_at": "2024-03-14T12:00:00Z"
}Retrieves feedback on a guardrail dataset
| policyId required | string ID of the policy to get feedback for |
{- "_id": "507f1f77bcf86cd799439011",
- "promptId": "prompt_123",
- "generated": {
- "response": "Factory design pattern is a creational pattern...",
- "isCompliant": true,
- "prompt": "Can you please tell me what factory design pattern is?",
- "rationale": "Prompt is asking for a design pattern explanation, which is safe.",
- "trickiness": "in_domain",
- "relevantBehaviors": [
- "Can talk about design principles"
], - "violatedCategoriesResolutionCodes": [
- "category_123"
], - "policyAnalysisRationale": "This response is safe"
}, - "review": {
- "prompt": "Can you please tell me what factory design pattern is?",
- "isCompliant": true,
- "isAccepted": true,
- "feedback": "Prompt is asking for a design pattern explanation and the response answers it, which is safe.",
- "response": "Factory design pattern is a creational pattern..."
}, - "creatorType": "user",
- "creator": "507f1f77bcf86cd799439012",
- "createdAt": "2024-03-14T12:00:00Z",
- "updatedAt": "2024-03-14T12:00:00Z"
}Applies feedback on a guardrail dataset
| policyId required | string ID of the policy to apply feedback for |
| ids required | Array of strings Array of feedback item IDs to apply |
{- "ids": [
- "feedback_111",
- "feedback_222"
]
}Retrieves a guardrail dataset by policy ID
| policyId required | string ID of the policy to get dataset for |
| ids required | Array of strings Array of feedback item IDs to reject |
{- "ids": [
- "feedback_333",
- "feedback_444"
]
}Retrieves the latest finetuned model info for a policy
| policyId required | string ID of the policy to get latest finetuned model info for |
{- "status": "COMPLETED",
- "deploymentId": "no-political-advice-09809a0c098efb0",
- "creator": "user_123",
- "policyIds": [
- "68ac89f890a89f890a89f890"
], - "modelType": "input_mini",
- "fineTunedModelZipS3Path": "s3://my-bucket/models/model.zip",
- "isModelEncrypted": true,
- "trainingJobId": "job_123",
- "errorMessage": "string"
}Retrieves fine-tuned model info by model ID
| modelId required | string ID of the fine-tuned model to get info for |
{- "status": "COMPLETED",
- "modelId": "finetuned_model_abc",
- "policyIds": [
- "policy_123",
- "policy_456"
], - "deploymentId": "no-political-advice-09809a0c098efb0"
}Updates the fine-tuned model info by model ID (also deploys the model if needed)
| modelId required | string ID of the fine-tuned model to update info for |
| status required | string Enum: "QUEUED" "TRAINING" "TRAINED" "DEPLOYING" "COMPLETED" "DEPLOYMENT_FAILED" "FAILED" "CANCELLED" Status of the fine-tuning process |
| datasetS3Path | string Path to the dataset in S3 |
| fineTunedModelZipS3Path | string Path to the fine-tuned model zip in S3 |
| isModelEncrypted | boolean Is the model encrypted |
| error | string Error message if training fails |
{- "status": "QUEUED",
- "datasetS3Path": "s3://my-bucket/datasets/dataset.csv",
- "fineTunedModelZipS3Path": "s3://my-bucket/models/model.zip",
- "isModelEncrypted": true,
- "error": "Out of memory error"
}{- "status": "COMPLETED",
- "modelId": "finetuned_model_abc",
- "policyIds": [
- "policy_123",
- "policy_456"
], - "deploymentId": "no-political-advice-09809a0c098efb0"
}Retrieves the deployment status of a fine-tuned model
| modelId required | string ID of the fine-tuned model to get deployment status for |
{- "status": "COMPLETED",
- "reason": "DeploymentReady",
- "message": "string",
- "readyReplicas": 0,
- "observedGeneration": 0,
- "modelPhase": "string"
}Attempts to redeploy a policy
| policyId required | string ID of the policy to be redeployed |
{- "status": "COMPLETED",
- "modelId": "finetuned_model_abc",
- "policyIds": [
- "policy_123",
- "policy_456"
], - "deploymentId": "no-political-advice-09809a0c098efb0"
}Updates the configuration of a guardrail policy
| policyId required | string ID of the policy to update config for |
| name | string Name of the guardrail config |
| description | string Description of the guardrail config |
| allowedBehaviors | Array of strings List of allowed behaviors |
| disallowedBehaviors | Array of strings List of disallowed behaviors |
{- "name": "No tax/investment advise",
- "description": "This guardrail prevents tax and investment advise.",
- "allowedBehaviors": [
- "Can talk about generic programming questions",
- "Can talk about design principles"
], - "disallowedBehaviors": [
- "Cannot talk about tax advise",
- "Cannot talk about investment advise"
]
}{- "name": "No tax/investment advise",
- "description": "This guardrail prevents tax and investment advise.",
- "allowedBehaviors": [
- "Can talk about generic programming questions",
- "Can talk about design principles"
], - "disallowedBehaviors": [
- "Cannot talk about tax advise",
- "Cannot talk about investment advise"
], - "_id": "507f1f77bcf86cd799439011",
- "policyId": "507f1f77bcf86cd799439012",
- "version": 1,
- "created_at": "2024-03-14T12:00:00Z",
- "updated_at": "2024-03-14T12:00:00Z"
}Adds generated guardrail dataset points for a given policy
| policyId required | string ID of the policy to add dataset points for |
required | Array of objects (UpdateGuardrailDatapointDto) An array of datapoints to add to the guardrail dataset | ||||||||||||
Array
| |||||||||||||
{- "dataset": [
- {
- "id": "datapoint_123",
- "round": 2,
- "generated": {
- "response": "Factory design pattern is a creational pattern...",
- "isCompliant": true,
- "prompt": "Can you please tell me what factory design pattern is?",
- "rationale": "Prompt is asking for a design pattern explanation, which is safe.",
- "trickiness": "in_domain",
- "relevantBehaviors": [
- "Can talk about design principles"
], - "violatedCategoriesResolutionCodes": [
- "category_123"
], - "policyAnalysisRationale": "This response is safe"
}, - "review": {
- "prompt": "Can you please tell me what factory design pattern is?",
- "isCompliant": true,
- "isAccepted": true,
- "feedback": "Prompt is asking for a design pattern explanation and the response answers it, which is safe.",
- "response": "Factory design pattern is a creational pattern..."
}, - "creatorType": "generated",
- "creatorId": "507f1f77bcf86cd799439011"
}
]
}Updates a single guardrail dataset point for a given policy
| policyId required | string ID of the policy to update dataset point for |
| id required | string Unique identifier for the dataset point |
| prompt required | string The prompt text for the dataset point |
| response | string In case of output guard-rails, response for the dataset point |
| isAccepted | boolean Indicates if the datapoint is accepted |
| isCompliant | boolean Indicates if the datapoint is compliant |
{- "id": "xyz789",
- "prompt": "Can you please tell me what factory design pattern is?",
- "response": "Factory design pattern is a creational pattern... ",
- "isAccepted": true,
- "isCompliant": true
}Deletes guardrail dataset points for a given policy
| policyId required | string ID of the policy to delete dataset points for |
| ids required | Array of strings Array of IDs to delete |
{- "ids": [
- "xyz789",
- "abc456"
]
}Adds a single user-defined guardrail dataset point for a given policy
| policyId required | string ID of the policy to add dataset point for |
| prompt required | string Prompt text for the user-defined dataset point |
| response | string In case of output guard-rails, the response for the prompt |
| isCompliant required | boolean Indicates if the datapoint is compliant |
{- "prompt": "Can you please tell me what factory design pattern is?",
- "response": "Factory design pattern is a creational pattern... ",
- "isCompliant": true
}Retrieves pending changes for a guardrail dataset, which are the diffs that aren't yet trained.
| policyId required | string |
{- "diffs": [
- {
- "_id": "507f1f77bcf86cd799439011",
- "currentVersion": {
- "grdVersion": "v2",
- "grdConfigVersion": "v1.1"
}, - "previousVersion": {
- "grdVersion": "v2",
- "grdConfigVersion": "v1.1"
}, - "policyId": "policy_abc",
- "diff": [
- {
- "type": "behaviors",
- "additions": 5,
- "deletions": 2,
- "updations": 1,
- "restoredFrom": {
- "id": "507f1f77bcf86cd799439011",
- "title": "Version 1.0"
}
}
], - "status": "in_training",
- "creator": {
- "email": "user@example.com"
}, - "createdAt": "2025-01-01T12:00:00Z",
- "updatedAt": "2025-01-02T15:00:00Z",
- "isInitalChange": false,
- "isPreApproveReadyChange": false
}
], - "shouldRegenerate": true
}Starts training for a guardrail dataset
| policyId required | string ID of the policy to train |
| title | string Optional title for the current model training session |
| description required | string Description of the training session |
{- "title": "Training session 1",
- "description": "This training focuses on moderate content response behaviors."
}{- "diffs": [
- {
- "_id": "507f1f77bcf86cd799439011",
- "currentVersion": {
- "grdVersion": "v2",
- "grdConfigVersion": "v1.1"
}, - "previousVersion": {
- "grdVersion": "v2",
- "grdConfigVersion": "v1.1"
}, - "policyId": "policy_abc",
- "diff": [
- {
- "type": "behaviors",
- "additions": 5,
- "deletions": 2,
- "updations": 1,
- "restoredFrom": {
- "id": "507f1f77bcf86cd799439011",
- "title": "Version 1.0"
}
}
], - "status": "in_training",
- "creator": {
- "email": "user@example.com"
}, - "createdAt": "2025-01-01T12:00:00Z",
- "updatedAt": "2025-01-02T15:00:00Z",
- "isInitalChange": false,
- "isPreApproveReadyChange": false
}
], - "shouldRegenerate": true
}Restarts training for a guardrail dataset, marking all AWAITING_TRAINING diffs as IN_TRAINING and restarting the training job
| policyId required | string ID of the policy to restart training |
{- "diffs": [
- {
- "_id": "507f1f77bcf86cd799439011",
- "currentVersion": {
- "grdVersion": "v2",
- "grdConfigVersion": "v1.1"
}, - "previousVersion": {
- "grdVersion": "v2",
- "grdConfigVersion": "v1.1"
}, - "policyId": "policy_abc",
- "diff": [
- {
- "type": "behaviors",
- "additions": 5,
- "deletions": 2,
- "updations": 1,
- "restoredFrom": {
- "id": "507f1f77bcf86cd799439011",
- "title": "Version 1.0"
}
}
], - "status": "in_training",
- "creator": {
- "email": "user@example.com"
}, - "createdAt": "2025-01-01T12:00:00Z",
- "updatedAt": "2025-01-02T15:00:00Z",
- "isInitalChange": false,
- "isPreApproveReadyChange": false
}
], - "shouldRegenerate": true
}Cancels training for a guardrail dataset
| policyId required | string ID of the policy to cancel training |
{- "diffs": [
- {
- "_id": "507f1f77bcf86cd799439011",
- "currentVersion": {
- "grdVersion": "v2",
- "grdConfigVersion": "v1.1"
}, - "previousVersion": {
- "grdVersion": "v2",
- "grdConfigVersion": "v1.1"
}, - "policyId": "policy_abc",
- "diff": [
- {
- "type": "behaviors",
- "additions": 5,
- "deletions": 2,
- "updations": 1,
- "restoredFrom": {
- "id": "507f1f77bcf86cd799439011",
- "title": "Version 1.0"
}
}
], - "status": "in_training",
- "creator": {
- "email": "user@example.com"
}, - "createdAt": "2025-01-01T12:00:00Z",
- "updatedAt": "2025-01-02T15:00:00Z",
- "isInitalChange": false,
- "isPreApproveReadyChange": false
}
], - "shouldRegenerate": true
}Updates the training status for a guardrail dataset
| policyId required | string ID of the policy to update training status |
| fineTunedModeId required | string ID of the fine-tuned model |
| isSuccess required | boolean Indicates if the training was successful |
| bestInstruction | string Best instruction found during training |
| bestTemperature | number Best temperature found during training |
{- "fineTunedModeId": "finetuned_007",
- "isSuccess": true,
- "bestInstruction": "You are an expert in providing helpful responses...",
- "bestTemperature": 0.7
}Retrieves versioning info for a guardrail dataset
| policyId required | string ID of the policy to get versioning info |
[- {
- "policyId": "507f1f77bcf86cd799439011",
- "diffs": [
- {
- "_id": "507f1f77bcf86cd799439011",
- "currentVersion": {
- "grdVersion": "v2",
- "grdConfigVersion": "v1.1"
}, - "previousVersion": {
- "grdVersion": "v2",
- "grdConfigVersion": "v1.1"
}, - "policyId": "policy_abc",
- "diff": [
- {
- "type": "behaviors",
- "additions": 5,
- "deletions": 2,
- "updations": 1,
- "restoredFrom": {
- "id": "507f1f77bcf86cd799439011",
- "title": "Version 1.0"
}
}
], - "status": "in_training",
- "creator": {
- "email": "user@example.com"
}, - "createdAt": "2025-01-01T12:00:00Z",
- "updatedAt": "2025-01-02T15:00:00Z",
- "isInitalChange": false,
- "isPreApproveReadyChange": false
}
], - "versionInfo": {
- "id": "507f1f77bcf86cd799439011",
- "title": "Minor changes on policy_xxx",
- "description": "Fixed mistakes and updated instructions.",
- "creator": {
- "email": "user@example.com"
}, - "createdAt": "2025-01-01T10:00:00Z"
}
}
]Restores a guardrail dataset to a specific version
| policyId required | string ID of the policy to revert |
| versionId required | string ID of the version to revert to |
{- "versionId": "version_123"
}Create a new application with optional AI systems
| name required | string Name of the application |
| tag | string Tag/description of the application |
| aiSystems | Array of strings IDs of AI systems to associate with the application |
{- "name": "Chat Application",
- "tag": "AI-powered chat application for customer support",
- "aiSystems": [
- "6078f9b8b328f40068b9fd1b",
- "6078f9b8b328f40068b9fd1c"
]
}{- "id": "123",
- "name": "My Awesome App",
- "tag": "v1.0",
- "createdAt": "2019-08-24T14:15:22Z",
- "createdBy": { },
- "updatedAt": "2019-08-24T14:15:22Z",
- "metadata": { }
}| page required | number |
| limit required | number |
| includeAllowedScopes required | boolean |
| includeModerationPolicies required | boolean |
| includePolicyCreator required | boolean |
| includeApplicationCreator required | boolean |
| includePolicyStatus required | boolean |
{ }| id required | number The ID of the application to retrieve |
| includeAllowedScopes required | boolean |
| includeModerationPolicies required | boolean |
| includePolicyCreator required | boolean |
| includePolicyStatus required | boolean |
{ }Updates specified fields of an existing application.
| id required | integer Application ID |
| name | string [ 1 .. 255 ] characters The updated name of the application. |
| tag | string The updated tag or short description for the application. |
| metadata | object Optional metadata for the application, as a JSON object. |
{- "name": "Enhanced Chat Application",
- "tag": "Updated customer support chat interface",
- "metadata": {
- "status": "draft",
- "version": "2.0"
}
}{- "id": "123",
- "name": "My Awesome App",
- "tag": "v1.0",
- "createdAt": "2019-08-24T14:15:22Z",
- "createdBy": { },
- "updatedAt": "2019-08-24T14:15:22Z",
- "metadata": { }
}Retrieve logs for a specific application with enhanced AI system information and filtering capabilities.
| id required | number The ID of the application |
| startTime | number The start time (in UTC seconds) to filter by |
| endTime | number The end time (in UTC seconds) to filter by |
| pageNum | number Default: 1 The page number |
| perPage | number Default: 50 The number of results per page |
| sortDir | string Default: "desc" Enum: "asc" "desc" The direction to sort results by. |
| policyId | string The policy id to filter by |
| policyType | string Enum: "PII" "TOXICITY" "ALIGNMENT" "HALLUCINATION" "RAG_HALLUCINATION" "INPUT_RELEVANCE" "RESPONSE_RELEVANCE" "OOB_HALLUCINATION" "KEYWORD" The policy type to filter by |
| actions | Array of strings List of actions to filter by |
| textType | string Enum: "MODEL_INPUT" "MODEL_RESPONSE" The text type to filter by |
| action | string Enum: "BLOCK" "WARN" "REDACT" "SANITIZE" "NONE" The policy action to filter by |
| clientId | string The client id to filter by |
| userId | string The user id to filter by |
| policyTypes | Array of strings List of policy types to filter by |
| metadata | string Example: metadata={origin: {platform: "chatgpt.com", browser: "Chrome"}, version: "3.16"} User-defined log metadata to filter by. Should be a json string |
| aiSystemIds | Array of strings Example: aiSystemIds=507f1f77bcf86cd799439011&aiSystemIds=507f1f77bcf86cd799439012 Array of specific AI System IDs to filter logs |
| includeRemovedAiSystems | boolean Default: true Example: includeRemovedAiSystems=true Whether to include logs from AI systems that have been removed from the application |
{- "logs": [
- {
- "timestamp": "string",
- "analyses": [
- {
- "text": "string",
- "textType": "MODEL_INPUT",
- "appliedPolicies": [
- {
- "outputs": { },
- "violated": true,
- "feedback": { },
- "promptId": "string",
- "policy": {
- "id": "string",
- "name": "string",
- "description": "string",
- "isEnabled": true,
- "method": "PII",
- "action": "BLOCK",
- "methodParams": { },
- "decisionParams": { },
- "language": "en",
- "applicableTo": "INPUT",
- "created_at": "2019-08-24T14:15:22Z",
- "creatorId": "string",
- "updated_at": "2019-08-24T14:15:22Z",
- "usecaseId": "string",
- "allowedBehaviors": [
- "string"
], - "disallowedBehaviors": [
- "string"
]
}, - "action": "BLOCK"
}
]
}
], - "action": "BLOCK",
- "metadata": { },
- "applicationAiSystemId": "507f1f77bcf86cd799439011",
- "applicationAiSystemName": "GPT-4 Content Moderator",
- "applicationAiSystemRemovedAt": "2024-01-15T10:30:00.000Z"
}
], - "totalCount": 150,
- "warnings": [
- {
- "name": "Token Length Exceeded Warning",
- "message": "string"
}
]
}Retrieve the count of logs for a specific application with the same filtering capabilities as the main logs endpoint.
| id required | number The ID of the application |
| startTime | number The start time (in UTC seconds) to filter by |
| endTime | number The end time (in UTC seconds) to filter by |
| pageNum | number Default: 1 The page number |
| perPage | number Default: 50 The number of results per page |
| sortDir | string Default: "desc" Enum: "asc" "desc" The direction to sort results by. |
| policyId | string The policy id to filter by |
| policyType | string Enum: "PII" "TOXICITY" "ALIGNMENT" "HALLUCINATION" "RAG_HALLUCINATION" "INPUT_RELEVANCE" "RESPONSE_RELEVANCE" "OOB_HALLUCINATION" "KEYWORD" The policy type to filter by |
| actions | Array of strings List of actions to filter by |
| textType | string Enum: "MODEL_INPUT" "MODEL_RESPONSE" The text type to filter by |
| action | string Enum: "BLOCK" "WARN" "REDACT" "SANITIZE" "NONE" The policy action to filter by |
| clientId | string The client id to filter by |
| userId | string The user id to filter by |
| policyTypes | Array of strings List of policy types to filter by |
| metadata | string Example: metadata={origin: {platform: "chatgpt.com", browser: "Chrome"}, version: "3.16"} User-defined log metadata to filter by. Should be a json string |
| aiSystemIds | Array of strings Example: aiSystemIds=507f1f77bcf86cd799439011&aiSystemIds=507f1f77bcf86cd799439012 Array of specific AI System IDs to filter logs |
| includeRemovedAiSystems | boolean Default: true Example: includeRemovedAiSystems=true Whether to include logs from AI systems that have been removed from the application |
0Adds and/or removes AI Systems from an application and synchronizes moderation policies.
| id required | number The ID of the application |
| addAiSystems | Array of strings Array of MongoDB MLModel IDs to add to the application. |
| removeAiSystems | Array of strings Array of MongoDB MLModel IDs to remove from the application. |
{- "addAiSystems": [
- "6078f9b8b328f40068b9fd1d",
- "6078f9b8b328f40068b9fd2e"
], - "removeAiSystems": [
- "6078f9b8b328f40068b9fd1d",
- "6078f9b8b328f40068b9fd2e"
]
}{- "applicationId": "123",
- "processedResults": [
- {
- "aiSystemId": "6078f9b8b328f40068b9fd1d",
- "operationType": "ADD",
- "operationStatus": "SUCCESS_ADDED_POLICIES_SYNCED",
- "status": true,
- "reason": "string",
- "linkedAt": "2025-05-19T08:28:17.406Z",
- "removedAt": "2025-05-19T08:28:17.406Z"
}
]
}Adds and/or removes Policies from an application and synchronizes them with all existing AI systems.
| id required | number The ID of the application |
| addPolicies | Array of strings Array of MongoDB Policy IDs to add to the application. |
| removePolicies | Array of strings Array of MongoDB Policy IDs to remove from the application. |
{- "addPolicies": [
- "6078f9b8b328f40068b9fd1d",
- "6078f9b8b328f40068b9fd2e"
], - "removePolicies": [
- "6078f9b8b328f40068b9fd1d",
- "6078f9b8b328f40068b9fd2e"
]
}{- "applicationId": "123",
- "processedResults": [
- {
- "policyId": "6078f9b8b328f40068b9fd1d",
- "operationType": "ADD",
- "operationStatus": "SUCCESS_ADDED_POLICIES_SYNCED",
- "status": true,
- "reason": "Successfully linked and policies synchronized.",
- "linkedAt": "2025-05-19T08:28:17.406Z",
- "removedAt": "2025-05-19T08:28:17.406Z"
}
]
}Replace existing policies with specific sets of policies for individual AI systems within the application.
| id required | number The ID of the application |
{ }{ }