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

推荐订阅源

小众软件
小众软件
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
WordPress大学
WordPress大学
月光博客
月光博客
Hugging Face - Blog
Hugging Face - Blog
博客园 - 聂微东
博客园 - 【当耐特】
博客园_首页
The Cloudflare Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Apple Machine Learning Research
Apple Machine Learning Research
Last Week in AI
Last Week in AI
酷 壳 – CoolShell
酷 壳 – CoolShell
大猫的无限游戏
大猫的无限游戏
雷峰网
雷峰网
量子位
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
T
Tailwind CSS Blog
IT之家
IT之家
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
GbyAI
GbyAI
V
Visual Studio Blog
F
Fortinet All Blogs
Martin Fowler
Martin Fowler

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
AI Coding Agents Need Runtime Guardrails, Not Just Human ...
Assili Salim · 2026-06-23 · via DEV Community

The recent signal

Anthropic engineering leader Fiona Fung, who leads teams behind Claude Code and Cowork, said AI coding agents have changed how her teams work.

The tools help engineers ship more code, but they also make the work lonelier. Developers spend more time working with agents and less time learning directly with other engineers. Fung’s response was to create more intentional collaboration: programming lunches, hackathons, and shared maker time.

That is an interesting culture story.

It is also an engineering story.

Because when developers move from working with humans to operating agents alone, some safety moves out of the room.

Human collaboration used to catch runtime mistakes

In normal engineering work, many mistakes are caught informally.

Someone asks:

Why are we retrying this again?

Why does this script have no timeout?

Why is this touching production?

Why did the dependency change?

Why is the task not making progress?

Why are we calling this API again?

These are not formal verification systems.

They are human runtime checks.

AI coding agents change the workflow.

A developer gives a task.

The agent plans.

The agent edits.

The agent runs tools.

The agent calls models.

The agent retries.

The agent adds context.

The agent tries again.

That loop can be useful.

It can also continue long after a human teammate would have stopped the run.

Agents are loops

A basic model call is simple.

You send input.

You get output.

You inspect the result.

An agent is different.

An agent can run through many steps:

while (!taskDone) {
const plan = await model.call(context);
const toolResult = await runTool(plan.tool);
context = updateContext(context, toolResult);
}

That shape is powerful, but incomplete.

There is no budget.

No max-step limit.

No retry-storm detection.

No prompt-loop detection.

No unknown-pricing check.

No no-progress detection.

A safer version has to ask whether the next provider call should happen at all.

const decision = guard.beforeCall({
runId,
model,
prompt,
stepCount,
budget,
previousPrompts,
retryState,
});

if (!decision.allowed) {
throw decision.error;
}

const result = await provider.call({
model,
prompt,
});

The important part is placement.

The guard runs before the provider call.

Not after.

Why dashboards are not enough

Dashboards are useful.

They show usage.

They show cost.

They help debug.

But they are usually post-execution.

They answer:

What happened?

Agent runtimes need to answer:

Should this next call happen?

That question matters because most AI-agent cost failures are not one huge request.

They are usually sequences of normal-looking calls.

A retry.

A similar prompt.

A tool call.

Another retry.

A longer context.

Another model call.

Each step may look reasonable.

The whole run may be waste.

Useful pre-call checks

A practical agent runtime should stop execution when basic safety conditions fail.

Budget guard

A run should have a task-level budget.

If the next estimated call crosses that budget, stop before the provider call.

Max-step protection

An agent that cannot finish within a reasonable number of steps may be stuck.

Max-step limits are not fancy.

They are production safety.

Retry-storm detection

Retries are normal.

Retry storms are not.

The runtime should detect when the agent keeps repeating failing behavior.

Similar prompt-loop detection

If prompts are nearly identical across repeated attempts, the agent may not be exploring new information.

That should trigger a stop or structured failure.

Unknown model pricing

If the runtime does not know the price of the model, it should fail closed.

Guessing inside an autonomous loop is dangerous.

Where AI CostGuard fits

This is the layer I am building with AI CostGuard.

AI CostGuard is a local-first TypeScript runtime safety layer for AI agents.

It is designed to prevent expensive agent failure modes before provider calls execute:

retry storms
prompt loops
max-step explosions
no-progress runs
budget overruns
unknown model pricing
runaway agent behavior

It is developer-focused.

No SaaS by default.

No cloud dashboard by default.

No login.

No tracking.

The goal is not to replace provider dashboards.

The goal is to stop known bad runtime patterns before they become provider spend.

The takeaway

AI agents make individual developers more capable.

They also reduce the human friction between intention and execution.

That means some safety has to move closer to the runtime.

If an agent can run alone, it needs limits.

If it can retry, it needs retry control.

If it can loop, it needs loop detection.

If it can call providers, it needs budgets.

If it can run unattended, it needs a kill switch.
https://github.com/salimassili62-afk/ai-costguard