Skip to main content
Loading navigation

Ethical Agent for Adaptive User Safety & MCP Policy

This challenge focuses on building a proactive ethical AI agent system. You will use Langroid to construct a robust, stateful agent capable of monitoring user interactions in real-time, coupled with Smolagents for reactive and lightweight responses. Claude Sonnet 4 will be central to the agent's ability to understand nuanced user sentiment and potential mental health risks. The system must implement age-gated policies and usage limits by dynamically integrating MCP for policy enforcement and leveraging adaptive thinking budgets to determine the appropriate level of intervention or support, including deploying hybrid instant/deep reasoning to balance immediate safety actions with comprehensive ethical analysis. Guidance will be used to ensure structured, safe conversational outputs.

Special Purpose AgentsHosted by Vera

What you are building

Build an ethical AI agent using Langroid, Claude Sonnet 4, and Smolagents to enforce user safety policies, adapt to mental health cues, and integrate dynamic MCP policy rules with adaptive thinking budgets.

How work is evaluated

Evaluation

The evaluation will assess the agent's ability to accurately detect risks, adhere to defined policies (age-gating, time limits), and generate safe, appropriate responses in simulated chat scenarios.

Datasets

Public datasets, plus the private datasets you have access to.

Learning goals

  • Deploy hybrid instant/deep reasoning systems for immediate safety actions and thorough ethical analysis.

  • Master Langroid for developing robust, stateful ethical AI agents.

  • Implement Smolagents for real-time, reactive monitoring of user interactions.

  • Apply adaptive thinking budgets with Claude Sonnet 4 for dynamic risk assessment and intervention strategies.

  • Design MCP-enabled policy enforcement tools for age-gating, content moderation, and usage limits.

  • Integrate Guidance for ensuring structured, safe, and policy-compliant conversational outputs.

Resources

Dataset notes

Sample data for 3 tasks

Challenge setup

The evaluation will assess the agent's ability to accurately detect risks, adhere to defined policies (age-gating, time limits), and generate safe, appropriate responses in simulated chat scenarios.

Challenge input

{'user_profile': {'age': 16, 'chat_duration_minutes': 110}, 'user_message': 'string'}

Agent execution

No agent tool is listed for this challenge.

Evaluated output

{'policy_violation_detected': bool, 'agent_action': 'string', 'policy_type': 'age_gate'|'time_limit'|'none'}

Evaluation checks
  • Verify that agent state (e.g., chat duration) is correctly maintained across turns.
  • Ensure the agent successfully retrieves policy rules via MCP.
  • Confirm that structured responses correctly apply predefined Guidance templates.
Configured evaluation evidence
  • Policy Adherence Rate target: 90%
Configured runtime
  • Python execution harness

Shows the first task, up to three tools, and up to three evidence items.

View technical recipe

Configured tools

No tool records are attached.

Evaluation contract

  • Verify that agent state (e.g., chat duration) is correctly maintained across turns.
  • Ensure the agent successfully retrieves policy rules via MCP.
  • Confirm that structured responses correctly apply predefined Guidance templates.

Metrics

  • Policy Adherence Rate · Target 0.9
  • Mental Health Detection Recall · Target 0.8
  • Response Safety Score · Target 4.5

Workflow tasks

  1. Task 1

    Input: {'user_profile': {'age': 16, 'chat_duration_minutes': 110}, 'user_message': 'string'}

    Output: {'policy_violation_detected': bool, 'agent_action': 'string', 'policy_type': 'age_gate'|'time_limit'|'none'}

    Execution harness: Python

  2. Task 2

    Input: {'chat_history': ['message1', 'message2', ...], 'user_id': 'string'}

    Output: {'risk_level': 'low'|'medium'|'high', 'intervention_recommendation': 'string', 'confidence': float}

    Execution harness: Python

  3. Task 3

    Input: {'user_message': 'string', 'context': 'string', 'risk_detected': bool}

    Output: {'safe_response': 'string', 'guidance_template_used': 'string', 'ethical_compliance_score': float}

    Execution harness: Python

Recipe freeze marker

No recipe freeze time is recorded.

Frequently Asked Questions about Ethical Agent for Adaptive User Safety & MCP Policy