<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Assili Salim</title>
    <description>The latest articles on DEV Community by Assili Salim (@assili_salim_e3c07f9954de).</description>
    <link>https://dev.to/assili_salim_e3c07f9954de</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3976311%2F67c79ee9-ba0f-4524-b372-e3e745e4dab4.png</url>
      <title>DEV Community: Assili Salim</title>
      <link>https://dev.to/assili_salim_e3c07f9954de</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/assili_salim_e3c07f9954de"/>
    <language>en</language>
    <item>
      <title>I’m building a local-first TypeScript guard for runaway AI-agent costs</title>
      <dc:creator>Assili Salim</dc:creator>
      <pubDate>Tue, 16 Jun 2026 10:07:36 +0000</pubDate>
      <link>https://dev.to/assili_salim_e3c07f9954de/im-building-a-local-first-typescript-guard-for-runaway-ai-agent-costs-3i53</link>
      <guid>https://dev.to/assili_salim_e3c07f9954de/im-building-a-local-first-typescript-guard-for-runaway-ai-agent-costs-3i53</guid>
      <description>&lt;p&gt;I’m building AI CostGuard, a local-first TypeScript / Node.js runtime safety layer for AI agents.&lt;/p&gt;

&lt;p&gt;The problem I’m working on is not model quality or prompt engineering.&lt;/p&gt;

&lt;p&gt;It is the boring failure mode where an agent keeps making provider calls because of bad control flow:&lt;/p&gt;

&lt;p&gt;retry storms&lt;br&gt;
similar prompt loops&lt;br&gt;
max-step explosions&lt;br&gt;
unknown model pricing&lt;br&gt;
accidental budget overruns&lt;br&gt;
repeated calls with no useful progress&lt;/p&gt;

&lt;p&gt;The goal is to block risky calls before the provider API execution happens.&lt;/p&gt;

&lt;p&gt;The current API is centered around guard() and guardFunction().&lt;/p&gt;

&lt;p&gt;The package currently includes:&lt;/p&gt;

&lt;p&gt;local-first runtime checks&lt;br&gt;
CLI budget checks&lt;br&gt;
local-only dashboard&lt;br&gt;
opt-in JSONL event logs&lt;br&gt;
structured errors&lt;br&gt;
mocked runnable examples for OpenAI, Anthropic, Vercel AI SDK, LangChain-style usage, Mastra-style runners, CrewAI budget gating, and CI checks&lt;/p&gt;

&lt;p&gt;Why this matters:&lt;/p&gt;

&lt;p&gt;A lot of tooling shows what happened after the agent already spent money.&lt;/p&gt;

&lt;p&gt;I’m interested in the smaller pre-call question:&lt;/p&gt;

&lt;p&gt;“Should this agent be allowed to make another provider call right now?”&lt;/p&gt;

&lt;p&gt;Limitations:&lt;/p&gt;

&lt;p&gt;token estimation is approximate&lt;br&gt;
provider pricing can change&lt;br&gt;
false positives are possible&lt;br&gt;
false negatives are possible&lt;br&gt;
local-first state has limits&lt;br&gt;
this is not a SaaS&lt;br&gt;
this is not a billing ledger&lt;br&gt;
this is not a hard security boundary&lt;br&gt;
this does not replace provider billing alerts or production observability&lt;/p&gt;

&lt;p&gt;npm:&lt;br&gt;
&lt;a href="https://www.npmjs.com/package/@salimassili/ai-costguard" rel="noopener noreferrer"&gt;https://www.npmjs.com/package/@salimassili/ai-costguard&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;GitHub:&lt;br&gt;
&lt;a href="https://github.com/salimassili62-afk/ai-costguard" rel="noopener noreferrer"&gt;https://github.com/salimassili62-afk/ai-costguard&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I’d appreciate technical feedback on:&lt;/p&gt;

&lt;p&gt;whether guard() / guardFunction() feel natural&lt;br&gt;
how false positives should be handled&lt;br&gt;
whether local-first state is actually useful in real agent systems&lt;br&gt;
what pricing assumptions are dangerous&lt;br&gt;
what failure modes I’m missing&lt;br&gt;
whether this should stay small or become more configurable&lt;/p&gt;

</description>
      <category>ai</category>
      <category>opensource</category>
      <category>api</category>
      <category>agents</category>
    </item>
  </channel>
</rss>
