Skip to content
Agent

MRF for Agents: Metaprompting Refinement Framework

by blakechasteen

AI Summary

MRF is a security-hardened metaprompting framework designed to protect AI agents from prompt injection attacks while enabling structured decision-making. It benefits developers building production agents on Claude platforms who need robust input sanitization and instruction clarity.

Install

Copy this and paste it into Claude Code, Cursor, or any AI assistant:

I want to set up the "MRF for Agents: Metaprompting Refinement Framework" agent in my project.

Please run this command in my terminal:
# Add AGENTS.md to your project root
curl --retry 3 --retry-delay 2 --retry-all-errors -o AGENTS.md "https://raw.githubusercontent.com/blakechasteen/hello-world/master/docs/agent-platform/MRF_FOR_AGENTS.md"

Then explain what the agent does and how to invoke it.

Description

🧵 HoloLoom: Neural decision-making system with weaving architecture. Combines multi-scale embeddings, knowledge graphs, Thompson Sampling exploration, and PPO reinforcement learning through a unique computational weaving metaphor.

Overview

The Metaprompting Refinement Framework (MRF) provides structured, security-hardened prompt engineering for all HoloLoom agents. MRF uses a principled 7-component structure with mandatory sanitization at every layer. Key Benefits: • +30% avg quality improvement across all agent types • Consistent structure for all agent prompts • Model-specific optimization (Claude, Gemini, GPT, Ollama) • Thompson Sampling learns best strategies per query type • 5-layer injection defense blocks attacks before they reach LLM ---

MRF for Agents: Metaprompting Refinement Framework

> "Every agent speaks with clarity. Every instruction is structured for success." > > "SANITIZE EVERYTHING. TRUST NO INPUT. DETECT INJECTION." Version: 2.0.0 Hardened Date: December 30, 2025 Security Level: CRITICAL - Prompt injection is the #1 attack vector ---

CRITICAL: Prompt Injection Defense Architecture

` ┌─────────────────────────────────────────────────────────────────────────────┐ │ MRF SECURITY-FIRST ARCHITECTURE │ │ │ │ Raw Input │ │ ↓ │ │ ┌─────────────────────────────────────────────────────────────────────┐ │ │ │ LAYER 1: INPUT SANITIZER (MANDATORY) │ │ │ │ • Pattern-based injection detection │ │ │ │ • Character normalization (Unicode attacks) │ │ │ │ • Length limits │ │ │ │ • Known jailbreak pattern matching │ │ │ └─────────────────────────────────────────────────────────────────────┘ │ │ ↓ │ │ ┌─────────────────────────────────────────────────────────────────────┐ │ │ │ LAYER 2: SEMANTIC ANALYZER │ │ │ │ • Intent classification │ │ │ │ • Manipulation detection (roleplay, authority claims) │ │ │ │ • Hidden instruction detection │ │ │ └─────────────────────────────────────────────────────────────────────┘ │ │ ↓ │ │ ┌─────────────────────────────────────────────────────────────────────┐ │ │ │ LAYER 3: MRF 7-COMPONENT ASSEMBLY (with injection guards) │ │ │ │ ROLE → OBJECTIVE → PROCESS → FORMAT → CONSTRAINTS → UNCERTAINTY │ │ │ │ → VALIDATION │ │ │ │ (Each component has injection-resistant templates) │ │ │ └─────────────────────────────────────────────────────────────────────┘ │ │ ↓ │ │ ┌─────────────────────────────────────────────────────────────────────┐ │ │ │ LAYER 4: OUTPUT VALIDATOR │ │ │ │ • Response format verification │ │ │ │ • Constraint violation detection │ │ │ │ • Jailbreak success detection │ │ │ │ • Alignment verification │ │ │ └─────────────────────────────────────────────────────────────────────┘ │ │ ↓ │ │ ┌─────────────────────────────────────────────────────────────────────┐ │ │ │ LAYER 5: CIRCUIT BREAKER │ │ │ │ • Injection attempt tracking │ │ │ │ • Automatic lockout on repeated attempts │ │ │ │ • Kill switch integration │ │ │ └─────────────────────────────────────────────────────────────────────┘ │ │ ↓ │ │ Sanitized, Validated Output │ └─────────────────────────────────────────────────────────────────────────────┘ ` ---

What Is Prompt Injection?

Prompt injection occurs when malicious input manipulates an LLM to: • Ignore its instructions - Override the system prompt • Execute unintended actions - Bypass safety constraints • Leak information - Reveal system prompts or data • Assume false roles - Pretend to be different agents

Discussion

0/2000
Loading comments...

Health Signals

MaintenanceCommitted 1mo ago
Active
AdoptionUnder 100 stars
2 ★ · Niche
DocsREADME + description
Well-documented

GitHub Signals

Stars2
Issues4
Updated1mo ago
View on GitHub
No License

My Fox Den

Community Rating

Sign in to rate this booster

Works With

Claude Code
Claude.ai