惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

N
Netflix TechBlog - Medium
罗磊的独立博客
云风的 BLOG
云风的 BLOG
Last Week in AI
Last Week in AI
Y
Y Combinator Blog
小众软件
小众软件
Blog — PlanetScale
Blog — PlanetScale
T
The Blog of Author Tim Ferriss
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
月光博客
月光博客
博客园 - Franky
F
Fortinet All Blogs
D
Docker
博客园 - 司徒正美
腾讯CDC
Recent Announcements
Recent Announcements
The Cloudflare Blog
B
Blog RSS Feed
GbyAI
GbyAI
T
Tailwind CSS Blog
雷峰网
雷峰网
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
博客园 - 三生石上(FineUI控件)
阮一峰的网络日志
阮一峰的网络日志

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
Why prompt filtering fails and what to do instead
9hannahnine- · 2026-05-17 · via DEV Community

9hannahnine-jpg

Every prompt injection defense I’ve seen makes the same mistake. It asks the wrong question.
The wrong question: “Does this prompt contain dangerous words?”
The right question: “Is untrusted content trying to become an instruction source?”
These are fundamentally different problems.

The problem with filtering
Keyword filters fail because attackers adapt. Base64 encode your attack. ROT13 it. URL encode it. Space out the characters. Wrap it in a code block. The filter sees nothing dangerous. The model follows the instructions.
We patched all of those encoding variants last week after someone found them in our public red team environment. The attacker had to work harder. But they got through on the first try.
Filtering is an arms race you will always lose eventually.

The real threat model
Prompt injection isn’t about dangerous vocabulary. It’s about unauthorized instruction-authority transfer.
Your agent has a clear hierarchy: system prompt at the top, developer instructions below that, user requests below that. The attack is when content from outside that hierarchy — a webpage, an email, a tool result, a retrieved document — tries to insert itself as a higher-authority instruction source.
A webpage telling your agent to “ignore previous instructions” isn’t dangerous because of the words. It’s dangerous because a zero-authority source is attempting to override a high-authority one.

The fix: source-aware authority enforcement
Every content chunk should carry a trust level:
• System prompt: 100
• Developer instructions: 90
• User input: 50
• Tool output: 10
• Webpage: 10
• Email: 10
• Retrieved document: 10
Rule: lower-authority sources can provide data. They cannot issue instructions.
When a webpage footer says “ignore previous instructions” — that’s not a dangerous phrase. That’s a source boundary violation. A zero-authority source attempting behavioral authority.

What this looks like in practice

from langchain_arcgate import ArcGateCallback
from langchain_openai import ChatOpenAI

llm = ChatOpenAI(callbacks=[ArcGateCallback(api_key="demo")])

One line. Every prompt gets source-tagged before it reaches the model. Untrusted content that attempts instruction-authority transfer gets blocked or sandboxed before the model sees it.
For ambiguous cases — content that’s suspicious but not clearly malicious — capabilities get reduced rather than hard blocking. The agent continues safely with tool calls and external actions stripped. Graceful degradation instead of binary block/allow.

Try to break it
We run a public adversarial evaluation environment. Submit attacks, get a full security trace back, download the JSON report.
https://web-production-6e47f.up.railway.app/break-arc-gate
Someone found a nested encoding bypass last week. It’s patched and documented in the public failure archive.
GitHub: https://github.com/9hannahnine-jpg/arc-gate
Built by Bendex Geometry.