Murnitur Shield offers enhanced control over your AI interactions by allowing you to replicate SDK functionalities through direct API requests. This approach provides a flexible way to integrate Murnitur Shield into your systems and workflows.

Overview

By using the API, you can achieve similar functionalities as the Murnitur Shield SDK, including custom payload handling, ruleset application, and configuration settings.

API Endpoint

To access more control features, use the following endpoint:

https://middleware.murnitur.ai/murnitur-shield

Request Structure

You can configure the request to include:

  • Payload: The content you want to analyze.
  • Rulesets: The specific rules and actions to apply.
  • Config: Configuration settings like provider and API key.

Example Request

{
  "payload": {
    "input": "Your message or content to be analyzed."
  },
  "rulesets": [
    {
      "rules": [
        {
          "metric": "input_pii",
          "operator": "contains",
          "value": ["email", "ssn", "address", "phone_number"]
        }
      ],
      "action": {
        "type": "OVERRIDE",
        "fallback": "Sorry, I can't provide personal identifiable information."
      }
    }
  ],
  "config": {
    "provider": "openai",
    "api_key": "sk-***"
  }
}

Example

How It Works

  1. Send Request: Submit a POST request to the endpoint with your payload, rulesets, and configuration.
  2. Process Response: Murnitur Shield evaluates the content according to the specified rulesets.
  3. Handle Triggers: Based on the response, determine if any rules were triggered and take the necessary actions.

By using the API directly, you gain more granular control over your interactions with Murnitur Shield, allowing you to tailor security checks to your specific needs and integrate them seamlessly into your workflows.