abuse_config object allows you to specify an abuse configuration to detect abuse across the project. The configuration can be set at four different levels:
- Project Level (
project_rpm): Sets a threshold for all requests to the project. If the RPM exceeds this threshold, the LLM call will be marked as unsafe. - Customer Level (
customer_rpm): Sets a threshold for all requests made by a customer for the project. If the customer’s RPM exceeds this threshold, the LLM call will be marked as unsafe. - Scope Level (
scope_rpm): Sets a threshold for all requests made within a scope for the project. If the scope’s RPM exceeds this threshold, the LLM call will be marked as unsafe, regardless of the customer. - Customer-Scope Level (
customer_scope_rpm): Sets a threshold for requests made by a customer within a given scope for the project. If the customer’s RPM for the scope exceeds this threshold, the LLM call will be marked as unsafe.
layerup.abuse guardrail with the appropriate abuse_config metadata.

