Guardrails integrates with Simple Log Service to collect, store, query, and analyze logs from security checks on AI model inputs and outputs in real time.
The log processing engine retrieves and analyzes tens of billions of log entries in seconds, helping you detect anomalies, trace threats, optimize security policies, and meet compliance requirements.
Log analysis
Enable log analysis
New users can enable Simple Log Service and set the storage capacity during Guardrails activation. A service-linked role is required to complete the setup.
If Guardrails is already activated, log on to the Guardrails console. On the page, enable log analysis.
Billing
Billing is based on the storage capacity you select (1 TB to 100 TB). The price is CNY 2 per TB per hour, and charges appear on your Guardrails bill.
The Log Analysis feature is billed on an hourly basis based on the storage capacity you select, with bills generated on a T+1 schedule. Fees accrue as long as the feature is enabled, even if no API calls are made or there is no actual usage. Additionally, if you have deployed custom detection agents in the console or have other auto-triggered mechanisms configured, call fees may also be incurred.
To stop billing for Log Analysis, go to the Guardrails console, navigate to , and click Modify Capacity in the upper-right corner of the page. On the configuration page, disable the Log Analysis feature by changing the setting to No, and then click Buy Now to submit the change. If you do not see this option, try switching to a different region and check again.
Log fields
Field name | Description | Example value |
account_id | Account | 154XXXX |
ram_account_id | RAM account ID | 234XXX |
region_id | Access Endpoint | cn-shanghai |
request_id | Request ID | AAAAAA-BBBB-CCCCC-DDDD-EEEEEEEE**** |
response_detail | Content compliance results, including risk labels and confidence scores. | / |
service | Service type | query_security_check |
total_time | Detection duration | XX ms |
used_api_name | Business API |
|
error_code | Status code | 200 |
error_message | Response message | OK |
error_code descriptions
error_code | Status code | Description |
200 | OK | The request is successful. |
400 | BAD_REQUEST | Invalid request. This may be because the request parameters are incorrect. Check the request parameters. |
408 | PERMISSION_DENY | This can occur if the account is not authorized, has an overdue payment, is not activated, or is disabled. |
500 | GENERAL_ERROR | A server-side error occurred. This may be a temporary error. Retry the request. If the error persists, contact us through online support. |
581 | TIMEOUT | Request timed out. Retry the request. If the error persists, contact us through online support. |
588 | EXCEED_QUOTA | Request rate exceeds the quota. |
FAQ
Why are logs empty or not showing up?
Logs are generated only when API requests return an HTTP 200 status code. No log entries are created in the following cases:
Your business has not actually integrated with the Guardrails API.
API calls failed or returned non-200 status codes.
If an API call returned success (HTTP 200) but no logs appear in the console, verify that you are viewing the correct location in the console. Make sure you are on the correct tab (for example, Model Protection tab under Log Analysis).
How long is log data retained?
Log data in the console is retained for 7 days. Historical data older than 7 days cannot be queried or viewed through the console.
Can I use a custom SLS Project?
No. The logs for Guardrails are automatically collected and written to an Alibaba Cloud Simple Log Service (SLS) Project and LogStore that are assigned by the system. Users cannot change the SLS Project or LogStore to a custom one. The SLS Project and LogStore information are automatically managed and can be viewed on the Log Analysis page.
How do I report a false negative (missed detection) by Guardrails?
If Guardrails fails to detect content that you believe should be flagged (a false negative), please provide the following information when submitting your feedback:
The RequestID of the specific API call that produced the result in question.
The specific text content that you believe was incorrectly handled.
You can submit this information through online support. The backend team will look up the corresponding record using the RequestID and make adjustments to improve detection accuracy.