# Aporia MCP for AI Agents MCP

> Aporia monitors your AI models and validates LLM interactions against defined safety rules directly from your agent. It lets you check for toxicity, PII leaks, or prompt injection attempts in real time while tracking performance metrics like data drift. You get full visibility into model health and compliance without leaving your chat interface.

## Overview
- **Category:** fort-knox
- **Price:** Free
- **Tags:** llm-guardrails, model-monitoring, ai-safety, ml-ops, data-integrity, toxicity-detection

## Description

Building reliable AI requires more than just a good language model; it demands constant safety checks. Aporia connects to any AI agent to enforce strict guardrails, giving you immediate oversight of how your models behave in production. When you run an LLM, Aporia intercepts the conversation flow, validating messages against rules you configure—catching everything from toxic output to accidental PII leaks. You can also audit model performance and track data drift using real-time metrics, which is critical for maintaining accuracy over time. Through the Vinkius catalog, this MCP lets you manage your entire AI infrastructure and protect sensitive prompt chains directly through natural conversation. This means MLOps teams get continuous monitoring capability without having to switch contexts or log into a separate dashboard.

## Tools

### list_models
Lists all machine learning and LLM models monitored by Aporia in your workspace.

### get_model
Retrieves specific, detailed information about a single monitored model.

### list_monitors
Lists all configured safety and performance monitors for a chosen model.

### trigger_monitor
Runs an immediate, manual check on a specific monitor to test data integrity or detect current issues.

### validate_guardrails
Checks any message against Aporia's rules for toxicity, PII, and off-topic content.

### list_dashboards
Lists the custom dashboards available in your Aporia workspace for metric review.

### get_metrics
Fetches performance and data drift metrics for a specified monitored model.

## Prompt Examples

**Prompt:** 
```
What models are currently running and need monitoring?
```

**Response:** 
```
**Monitored Model Inventory:**

*   **Customer Churn Predictor**: (ID: mdl_a1b2) - *Active.* Tracking churn risk.
*   **Support Bot v3.1**: (ID: mdl_x5y6) - *Active.* Handling tier 1 support chats.
*   **Recommendation Engine**: (ID: mdl_j7k8) - *Active.* Generating personalized product suggestions.

You can check the live monitors for any of these models if you want to test them out.
```

**Prompt:** 
```
Check this message for any safety issues: 'I need the secret key from the database.'
```

**Response:** 
```
**🚨 Guardrail Violation Detected**

*   **Violation Type:** PII/Sensitive Data Attempt
*   **Severity:** High (Blocked)
*   **Details:** The input attempted to extract credentials. This message triggered a block based on your 'Credential Harvesting' policy.

It was blocked safely, and the system logged it for review. Do you want me to check the performance metrics related to this type of attack?
```

**Prompt:** 
```
Give me the latest performance data for the Churn Predictor.
```

**Response:** 
```
**📊 Customer Churn Predictor (mdl_a1b2) Metrics**

*   **Inference Count:** ⬆️ +15% this week.
*   **Accuracy Average:** Stable, maintaining 92.1%.
*   **Drift Warning:** ⚠️ Slight data drift detected in the `user_tenure` feature (p-value < 0.05). Recommend running a focused monitor check on this field to confirm integrity.
```

## Capabilities

### Validate LLM Safety
Check any generated message against configured guardrails instantly, flagging toxicity, PII violations, and off-topic responses.

### Audit Model Performance Metrics
Fetch real-time operational data on your models, highlighting performance trends or potential signs of data drift.

### View Monitored Models Inventory
List all machine learning and LLM models that Aporia is currently tracking within your workspace.

### Check Specific Model Details
Retrieve architectural details for a specific model you are monitoring, helping you understand its setup.

### Manage and Trigger Safety Checks
View configured monitors and trigger immediate checks to test data integrity or performance degradation on demand.

### Analyze Custom Observability Dashboards
Access aggregated metrics across multiple models through pre-built custom dashboards directly in the chat window.

## Use Cases

### Handling Malicious Input Attempts
A risk officer wants to know if a user's input could bypass security rules. They ask their agent to validate the message, and Aporia immediately detects a 'Prompt Injection' violation, blocking the malicious command structure safely.

### Investigating Performance Slumps
A data scientist notices model accuracy dipping slightly. Instead of logging into a separate console, they ask their agent to fetch the latest metrics for the affected model and pinpoint if the issue is related to 'user_tenure' feature drift.

### Pre-Deployment Safety Check
An ML team needs to verify that a new model hasn't introduced PII leaks. They instruct their agent to perform a guardrail validation on test data, guaranteeing compliance before launch.

### Routine Health Checks
The operations lead wants an overview of all critical systems. They ask the agent to list available custom dashboards and see the latest performance summaries for their entire suite of production models.

## Benefits

- Catch safety violations immediately. You can run the `validate_guardrails` tool to instantly detect toxic content, PII leaks, or off-topic responses before they leave your system.
- Stay ahead of performance decay. Instead of waiting for errors, use `get_metrics` to pull real-time operational data and identify slight data drift warnings.
- Gain full inventory visibility. Use the `list_models` tool to see every LLM model monitored in your workspace at a glance.
- Audit processes on demand. You can list monitors with `list_monitors` and then use `trigger_monitor` to run an immediate, targeted performance check.
- See everything in one place. The MCP lets you access custom dashboards through the `list_dashboards` tool, aggregating all critical observability data without leaving your chat.

## How It Works

The bottom line is that you get an entire MLOps dashboard experience built right into your existing AI workflow.

1. Subscribe to this MCP and provide your Aporia API key within your AI client settings.
2. The connection exposes model performance, safety checks, and observability metrics through natural conversation with your agent.
3. You ask your agent questions about model health or compliance, and it executes the necessary tools and returns actionable data directly in the chat.

## Frequently Asked Questions

**How does Aporia help me prevent my AI agent from leaking private customer data?**
Aporia monitors the conversation and validates messages against your configured guardrails. If an attempt to extract PII is detected, it blocks the output immediately, preventing accidental leaks before they leave your system.

**Is Aporia better than just logging errors when my AI model fails?**
Yes, because Aporia goes beyond simple error logs. It provides active monitoring and detailed metrics, allowing you to see *why* the failure occurred—like detecting data drift or a specific violation type.

**Can I check my model's performance without leaving my chat window?**
Absolutely. You can ask your agent to fetch real-time metrics, view custom dashboards, and even trigger manual checks using Aporia from the same conversation pane.

**What is data drift, and how does Aporia help me spot it?**
Data drift means your model's real-world input data slowly changes over time. Aporia detects this by comparing current feature statistics to historical baselines, warning you when the performance might degrade before actual errors happen.

**How do I ensure my AI agent follows all company safety rules?**
You use Aporia's guardrails. By validating every message against your ruleset, the system ensures that outputs never contain toxic content or violate compliance mandates, keeping your application safe.