SShortSingh.
Back to feed

Detecting AI Agent Loops With Local Hashes Instead of Sending Sensitive Payloads

0
·3 views

A DEV Community guide explains how to spot repeated AI agent actions, such as the same tool call with identical arguments, without transmitting raw payloads like customer records or private prompts. It relies on locally computed hashes, enabled by the hash_only=True option in AgentTrafficCop SDK 1.2.0, which the author is building. The walkthrough uses a test API key, runs a guard check before each tool call, and expects the third identical attempt to be rejected with REPEATED_PAYLOAD_LOOP under default settings. The article stresses that this method covers exact repeats and sequences only, not semantic loops, and that it cannot stop operations that bypass the check. It also notes that model calls used to choose a tool need their own guard if they must be protected.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingDEV Community ·

Google's site: search returns empty results for pages it has indexed

Since around 19 November 2026, searching Google with site: plus a page's full address often returns nothing, even for pages that are indexed. Before that change, the same search usually displayed the page. A developer running a bulk index checker found that about three in ten of 85 pages marked as not indexed were actually present when re-checked on 21 November. Results that do show a page remain reliable, but an empty site: response no longer proves a page is missing. The author suggests searching the bare URL without the operator and repeating the query before concluding a page is not indexed. Google has not explained the change, and it is unclear whether it is limited to certain markets.

0
ProgrammingDEV Community ·

AWS IMDSv2 Architecture Explained: How Session Tokens Help Block SSRF Attacks

The Amazon EC2 Instance Metadata Service gives running instances details about their environment, including temporary IAM credentials, which makes it a sensitive internal target. Server-Side Request Forgery flaws can let attackers reach this endpoint from inside an application. AWS introduced IMDSv2 to make such attacks harder by requiring a session token obtained through a PUT request before metadata can be read. The token has a configurable lifetime of one second to six hours and is sent in a header with subsequent requests. The article also covers enforcing IMDSv2 at scale using AWS CLI, Terraform, and Service Control Policies.

0
ProgrammingDEV Community ·

Complex branching in pull requests linked to 29% higher agent review token costs

A developer found that their monthly AI agent review bill for a Node service rose about 18% while pull request volume stayed roughly flat. Referencing a study of 465 open source pull requests that tied low code health to 22-35% higher inference costs, they examined 36 merged pull requests from their own service. Using a crude proxy counting branching constructs in added lines, they compared the most branch-dense third of changes against the least. The densest third consumed about 29% more input tokens per changed line, a result within the range the larger study reported. The author cautions that this small single-service sample is not a rigorous confirmation of the effect.