Painel de Notícias

Tecnologia

4052 posts · 26 feeds · tópicos e interesse por Jev

Filtros1
dev.to

Safely Running AI-Generated Code in Node.js: `vm` vs `worker_threads` vs V8 Isolates

With the rise of autonomous AI agents and code-interpreting LLM features, Node.js backends are increasingly required to execute code generated on the fly. However, running arbitrary user or AI code inside a Node.js process is dangerous. A single malicious or hallucinated script can read environment variables (process.env), spawn OS processes (child_process), freeze the event loop with infinite loops, or crash your entire server by exhausting heap memory. In this post, we’ll analyze the three primary methods for executing isolated code in Node.js, why built-in modules fail at security, and how to implement true V8 heap sandboxing. vm Module: Great for Context, Terrible for Security Node.js ships with a built-in vm module that allows compiling and running code within a synthetic context. import vm from 'node:vm'; const context = { x: 2 }; vm.createContext(context); // Looks sandboxed, but IS NOT SECURE! vm.runInContext('x += 40;', context); The Node.js documentation explicitly states: "The vm module is not a security mechanism. Do not use it to run untrusted code." Because the context objects inside vm still inherit from the host process's standard prototypes, untrusted code can escape the sandbox via constructor chain navigation: // Exploiting Node.js vm to execute host OS commands const code = ` this.constructor.constructor('return process')().mainModule.require('child_process').execSync('whoami'); `; vm.runInContext(code, context); // Executed on your host machine! worker_threads: Good for Offloading, Weak for Isolation Node.js worker_threads move execution off the main event loop onto a separate thread. import { Worker } from 'node:worker_threads'; const worker = new Worker('./worker-script.js', { workerData: { code: 'console.log("Hello from worker");' } }); Pros: Non-blocking. If the guest script runs an infinite loop, the main event loop remains responsive. You can also destroy the thread via worker.terminate(). Cons: High memory footprint (each worker instantia

DevSegurança
Interesse
dev.to

CVE-2026-41264: How a Regex Let Prompts Run Code in Flowise

import pandas as np, os as pandas pandas.system("xcalc") Those two lines are the whole bypass in CVE-2026-41264, a CVSS 9.8 bug in Flowise, the open source drag-and-drop builder for LLM apps. Flowise's CSV Agent asked a model to write pandas code, checked the code with a regex, and ran it on the server. The regex was meant to stop any import other than pandas or numpy. It looked at the first module name after import and stopped there. Alias os as pandas and the check passes. The bug is worth studying because of what happened after it was reported. The fix in 3.1.0 was a stricter regex. Over the next three months the validator grew to 390 lines, picked up five more CVEs, and in June Flowise deleted the feature. If you build or test anything that runs model-generated code, that history is the lesson. Trend Micro's Zero Day Initiative reported the bug as ZDI-CAN-29411. The researchers credited are Dre Cura and Nicholas Zubrisky of TrendAI Research. Their analysis is published in full in the Flowise advisory GHSA-3hjv-c53m-58jj. The flow inside CSV_Agents.run(), as the advisory quotes it: Load the uploaded CSV in Pyodide and extract column names and dtypes with pandas. Fill a prompt template with those dtypes and the user's question. The template ends with a "Security:" paragraph telling the model not to use import, exec, eval, open, os or subprocess. Take the model's reply, strip Markdown fences, and store it as pythonCode. Run validatePythonCodeForDataFrame(pythonCode), a loop over 34 forbidden regexes. Execute import pandas as pd\n plus pythonCode with pyodide.runPythonAsync(). Step 2 is a request to the model, not a control. Step 4 is the only real check, and step 5 is where it fails. An unauthenticated attacker reaches all of it because /api/v1/prediction/ sits on Flowise's WHITELIST_URLS. The ZDI proof of concept puts a prompt injection in the question field asking the model to reply with the payload above. The advisory says it was tested against Llama 3.2 in Olla

SegurançaDevIA
Interesse
Smashing Magazine

Weaponizing And Defending The React Flight Protocol: Deserialization Sinks In RSCs

While React Server Components rely on the custom Flight protocol to stream interactive UIs, this same mechanism introduces powerful deserialization sinks that attackers can exploit. Durgesh Pawar breaks down the mechanics behind the CVSS 10.0 “React2Shell” vulnerability to show how protocol manipulation can lead to remote code execution.

SegurançaDev
Interesse
dev.to

Running LaMa Inpainting and Real-ESRGAN in the Browser: Tiles, Memory Walls, and the Optimizations We Threw Away

We build ClearPix, a set of media cleanup tools that run entirely in the browser — no uploads, no server GPUs. That means when a user removes a watermark, a 198MB LaMa inpainting model runs inside their tab, and when they upscale an image, Real-ESRGAN runs next to it in the same JavaScript heap. This post is about what it actually takes to ship that: why we pin a flagship inpainting model to WASM on purpose, how tiled inference keeps large images from blowing up the tab, which "obvious" optimizations we benchmarked and threw away, and the one rule that saved us repeatedly — profile before you touch anything. Server-side model selection is mostly about quality-per-FLOP. In the browser that framing breaks down completely. Our constraints, in order of how often they bite: Memory. Model weights, WASM linear memory, tensors, source image, and output canvas all live in one renderer process. A 4K image alone is ~33MB as RGBA. Hold a large ONNX session open at the wrong moment and Chrome kills the tab — no exception, the page just vanishes. Driver stability. A WebGPU session that creates successfully says nothing about whether session.run() will return. We've seen big models deadlock mid-inference on specific GPU/driver combinations with no error at all. FLOPS. Barely matters. Our profiling keeps showing browser inference is memory-bandwidth-bound, not compute-bound. This is why our model choices look odd from a papers-first perspective: we run Real-ESRGAN's compact general-x4v3 variant instead of the classic RRDBNet x4plus — the "weaker" model won every acceptance case while running an order of magnitude faster, because "fast in the browser" is a property of the architecture, not the runtime. The full model-selection benchmark (and what happened when we later quantized the winner to fp16) is part 3 of this series; here we focus on what those models cost once they're loaded. Our watermark remover ships two inpainting engines, and we picked them on a bench suite rather than

IADev
Interesse
dev.to

6 Production Rules to Delete User Accounts and Revoke Sessions Safely

Treat account deletion as a durable, one-way state machine, and make credential invalidation the first externally visible transition. For an education platform that accepts Google and GitHub sign-in, the practical rule is: block new logins, revoke local sessions and API keys, erase owned data through retryable steps, and retain only the minimum tombstone needed to make retries harmless. TL;DR: use six stages: requested, locked, credentials_revoked, data_erased, provider_unlinked, and completed. A repeated request must return the same operation identifier; a crashed worker must resume from durable state; and completion must never imply that an upstream identity-provider account was deleted. The page worth trusting is "a locked account still authenticated," not a green dashboard saying the queue is healthy. Social sign-in separates identity proof from the application account. Google or GitHub can still issue a valid identity assertion after the learning-platform profile is gone, because deleting the local profile does not delete the person's upstream account. If the callback treats every valid assertion as permission to create a profile, the next login can resurrect an erased student with the same provider subject. That is the failure mode I would design the page around. The callback must check a deletion tombstone keyed by the issuer and provider subject before provisioning anything. It must also reject an account whose deletion state has reached locked, even when an older browser cookie remains cryptographically valid. Signature verification answers whether a token was issued by the expected authority; it does not answer whether this application still permits the account to act. Bot resistance changes the front door, too. Do not let an anonymous caller use the deletion endpoint as an account-enumeration oracle. Require a recently authenticated session, apply the same response shape regardless of whether a background operation already exists, and step up authenticati

SegurançaDev
Interesse
dev.to

Why Your TypeScript Code Still Crashes in Production: Validating Data at Runtime Boundaries with Zod

Mình từng review một incident lúc 2 giờ sáng: service Node.js crash hàng loạt với lỗi TypeError: Cannot read properties of undefined (reading 'toFixed'). Codebase 100% TypeScript, bật strict: true, CI xanh, không có any nào. Vậy mà vẫn sập. Nguyên nhân là bên đối tác đổi field price từ number sang string "12.50", và có record thì trả về null. TypeScript không hề biết chuyện này, vì type chỉ tồn tại lúc compile, còn data thật đến lúc runtime. Bài này chia sẻ cách mình xử lý vấn đề đó trong các dự án thực tế: xác định trust boundary và validate data ngay tại đó bằng Zod (v4), cùng vài option tsconfig ít người bật nhưng rất đáng bật. TypeScript bị type erasure: sau khi compile ra JavaScript thì toàn bộ type biến mất. Mọi chỗ bạn viết as SomeType hay khai báo kiểu trả về cho response.json() thì thực chất bạn đang hứa với compiler, chứ không ai kiểm tra lời hứa đó cả. Đây là đoạn code mình gặp nhiều nhất: interface Product { id: string; name: string; price: number; } async function getProduct(id: string): Promise { const res = await fetch(`https://api.partner.com/products/${id}`); return res.json() as Promise ; // lời hứa suông } const product = await getProduct("abc"); console.log(product.price.toFixed(2)); // crash nếu price là null hoặc string Compiler thấy ổn, IDE autocomplete đẹp, nhưng res.json() trả về Promise , và any thì cast sang gì cũng được. Những chỗ hay dính kiểu bug này: Response từ API bên ngoài (fetch, axios) JSON.parse() từ file, cache Redis, message queue process.env Request body, query string, form data localStorage, URL params ở frontend Kết quả từ LLM API (structured output cũng có lúc trả sai schema) Điểm chung: đều là data đi từ bên ngoài vào hệ thống. Cách nghĩ mình áp dụng: chia hệ thống làm hai vùng. Bên ngoài là vùng unknown, không tin gì cả. Bên trong là vùng đã được kiểm tra, type đúng thật. Validate đúng một lần tại ranh giới, sau đó bên trong code thoải mái dùng type mà không cần check if (x && x.y) khắp nơi. flowchart LR A[External API] -

Dev
Interesse
dev.to

Your NPM_TOKEN stops publishing in January 2027. Here's the one-command migration

If your GitHub Actions release publishes to npm with a NPM_TOKEN secret, it has an expiry date. From January 2027, a granular token that bypasses 2FA can no longer publish on its own (npm docs). Since August 2026 you've probably seen this warning in your release logs: npm notice npm tokens that bypass 2FA are being restricted for account changes and direct publishing. The replacement is trusted publishing. GitHub signs a short-lived OIDC token for your workflow run, npm exchanges it for a publish token, and nothing long-lived is stored anywhere. You also get a provenance badge on every release for free. The idea is simple. The migration has a handful of sharp edges. For a typical release workflow: Give the job an OIDC token. Add permissions: id-token: write to the publishing job. If the job had no permissions block before, keep whatever else it needs, such as contents: write for tagging. Use npm 11.5.1 or newer. This is the one that bites. Node 22 ships npm 10, so you need Node 24 or an npm install -g npm@^12 step before publishing. Remove the token. Delete NODE_AUTH_TOKEN / NPM_TOKEN from the publish step and the job. npm falls back to a configured token, so leaving it in keeps the old token in use. Set registry-url on actions/setup-node. Fix repository.url in package.json. npm checks it against the repository the workflow runs in. Connect the package to the workflow on npm. Either open npmjs.com → package → Settings → Trusted publishing, or run: npm trust github my-pkg --repo me/my-repo --file release.yml --allow-publish --yes The workflow file name must match exactly. With reusable workflows, it's the calling workflow's file. Delete the secret after the first tokenless release. These messages don't point at the cause. Here's what each one usually means. npm error code ENEEDAUTH No id-token: write, npm older than 11.5.1, or a workflow file name that doesn't match the trusted publisher exactly (it's case-sensitive and includes .yml). npm error 404 Not Found - PUT h

DevInfra
Interesse
dev.to

The silent retry bug killing ASP.NET Core reliability (and how idempotency keys save you)

The Silent Retry Bug: Why Your Resilient .NET System Is Actually Fragile If you’ve spent any time working with distributed systems in C# and ASP.NET Core, you know the drill: network calls fail, timeouts happen, and services become temporarily unavailable. The standard advice? Use Polly. Add a retry policy. Make it resilient. But here’s the hard truth: retries without idempotency are dangerous. When you retry a GET request, it’s usually safe. It’s just reading data. But when you retry a POST or PUT request, you risk changing state. If the first request actually succeeded (but the client didn’t receive the response due to a timeout), the retry will execute the logic a second time. In a payment system, that’s a double charge. In an e-commerce platform, that’s a duplicate order. This "duplicate-state problem" is the quiet killer of reliability. Most retry strategies (Polly, Hangfire, Azure Service Bus) operate on an "at least once" delivery guarantee. This means you will retry if something looks like it failed. However, unless your endpoint is idempotent, a successful first call followed by a failed second call (or a successful second call that thinks it's the first) leads to data inconsistency. The fix isn't a more sophisticated retry policy. It's making your POSTs safely repeatable. The industry-standard pattern is the Idempotency Key. Client Side: The client generates a unique identifier (usually a GUID) for the intent of the operation (e.g., "Place Order #1234"). This key is attached to the HTTP request, often in the Idempotency-Key header. Server Side: The ASP.NET Core endpoint checks if this key has been seen before. If new: It executes the business logic, saves the result, and stores the key-result pair (with a TTL). If existing: It skips the business logic and returns the stored result immediately. While you can build this manually, it’s best practice to encapsulate it in a middleware or a filter so every endpoint benefits from it. Here is a conceptual outline

Dev
Interesse
dev.to

Postgres Let Two Rows Through a Unique Index: The glibc Collation Trap After an OS Upgrade

If a unique index suddenly tolerates duplicates, or WHERE email = ... misses a row that a sequential scan finds, the index is sorted by collation rules that no longer match what your OS provides. That happens when the C library's sort order changes — most famously in glibc 2.28 — and it is not a Postgres bug, a replication bug, or a bad disk. The fix is to rebuild every index on a text column, then tell Postgres which collation version it is now running against. I hit this after the most boring change imaginable: bumping a Docker base image from Debian 10 to Debian 12 for a staging database. The data directory was on a mounted volume, so it survived. The sort order underneath it did not. The symptoms are inconsistent enough that you distrust your own code first, which is why this costs people days: Symptom What's really happening INSERT succeeds on a value that already exists in a UNIQUE column The index probe walked the b-tree using new sort rules and never reached the existing entry SELECT ... WHERE name = 'x' returns nothing, but SELECT ... WHERE name LIKE 'x' returns a row The first uses the index, the second forces a scan ORDER BY name returns a different order than it did last week The comparison function itself changed count(*) differs depending on whether a filtered index is used Index-only scans see a subset On Postgres 15+, every connection logs a collation version mismatch warning Postgres is telling you directly That last row is the gift. Since Postgres 15, connecting to a database whose recorded collation version doesn't match the OS produces: WARNING: database "app" has a collation version mismatch DETAIL: The database was created using collation version 2.28, but the operating system provides version 2.36. HINT: Rebuild all objects in this database that use the default collation and run ALTER DATABASE app REFRESH COLLATION VERSION. Collation version tracking for libc collations landed in Postgres 13 at the collation level, and Postgres 15 extended it

InfraDevLinux
Interesse
dev.to

Your multi-tenant SaaS needs a test that tries to leak data

Most multi-tenant SaaS products keep customers apart with one line of code repeated a few hundred times: const invoice = await db.invoice.findFirst({ where: { id: req.params.id, tenantId: req.user.tenantId }, }); That works until someone writes the query without the tenantId. It might be a new endpoint, an export job, or a "quick" admin route. Nothing fails. The tests pass, because the tests only ever log in as one tenant. Then one customer sees another customer's invoice. AWS's whitepaper on SaaS tenant isolation puts the stakes plainly: crossing the tenant boundary "in any form would represent a significant and potentially un-recoverable event for a SaaS business." The same class of bug sits at the top of the OWASP API Security Top 10 (2023) as API1: Broken Object Level Authorization. The fix that holds up is boring: write tests whose only job is to try to read another tenant's data, and run them on every release. Below is the setup we use, in TypeScript with Jest and Supertest, plus Postgres row-level security as a second line of defence. Each cross-tenant test needs a victim. Seed two tenants that each own one of every resource type. // test/fixtures/tenants.ts export async function seedTwoTenants(db: Db) { const a = await db.tenant.create({ data: { name: "Tenant A" } }); const b = await db.tenant.create({ data: { name: "Tenant B" } }); const userA = await createUser(db, a.id, "alice@a.test"); const userB = await createUser(db, b.id, "bob@b.test"); // One of every resource for tenant B: the data we will try to steal. const bData = { invoiceId: (await db.invoice.create({ data: { tenantId: b.id, total: 100 } })).id, projectId: (await db.project.create({ data: { tenantId: b.id, name: "B project" } })).id, fileId: (await db.file.create({ data: { tenantId: b.id, key: `${b.id}/report.pdf` } })).id, }; return { a, b, userA, userB, bData }; } The test is only as good as its coverage. Generate the list from your router if you can. If you can't, keep it as a table in the

SegurançaDev
Interesse
dev.to

Why Hermes bytecode defeats binary diffing — and how we got a one-line OTA hotfix down to 3.4 KB

Disclosure: I maintain react-native-update, the open-source SDK behind Cresc, an OTA update service for React Native. The benchmark code and data are public, and the technique applies to anyone shipping Hermes bundles. If you ship React Native over-the-air updates, you've probably assumed binary diffing solves the bandwidth problem: compute a bsdiff between the old and new bundle, send the patch, done. With plain JS bundles that's mostly true. With Hermes bytecode it isn't, and the reason is interesting. We measured on real release bundles of a React Native 0.86 app (Hermes HBC v98, with common dependencies like Paper, SVG, Sentry and CameraKit; ~1.5 MB gzipped): Release scenario Full bundle (gzip) Classic bsdiff Hermes-aware diff One-line text change 1,544.6 KB 93.7 KB 3.4 KB (28× smaller) Small feature (+1 component, ~60 LOC) 1,555.8 KB 411.6 KB 50.2 KB (8.2× smaller) Medium feature (+2 screens, ~300 LOC) 1,604.7 KB 551.6 KB 97.8 KB (5.6× smaller) A one-line change producing a 94 KB bsdiff patch is the giveaway: something is amplifying tiny source edits into large binary changes. Hermes stores strings in a table and refers to them by ID throughout the bytecode. On every compile it sorts that table by identifier frequency, so a one-line change perturbs the frequencies and renumbers dozens or hundreds of string IDs. Every instruction that references a shifted ID changes too. Result: two builds that differ by one line of JS end up differing in bytes all over the file. A generic diff algorithm sees thousands of scattered edits. Fix: Hermes has a delta mode (hermesc -base-bytecode= ). Compiling every release against the root bytecode of its version chain pins existing string IDs in place, so only code that actually changed shows up in the diff. Hermes embeds debug info in the bytecode by default. Compiling with -output-source-map moves it into an external .map, which shrinks the bytecode by about 21% before any diffing happens. You keep the map for symbolicating crashe

DevMobile
Interesse
dev.to

Why Decoding a JWT Is Not Verifying It (And How Security Bugs Slip Through)

In an algorithm confusion attack, an attacker takes your public key (which is publicly accessible), changes the token header from RS256 to HS256, and signs the token using your public key string as an HMAC secret! If your backend verifier doesn't enforce the algorithm, it might treat the public key as raw HMAC bytes and validate the forged signature as legitimate. algorithms=["RS256"] explicitly on your verifier. Never allow the token header to dictate which cryptographic algorithm to execute. 5. Debugging Tokens Locally Without Leaking Secrets During local development and testing, you frequently need to inspect token payloads, check exp timestamps, and debug custom claims. DevOmniTools JWT Decoder Frontends decode tokens solely for UI rendering—never for authorization logic. Backends verify the cryptographic signature on every single protected API route. Never expose symmetric HMAC secrets inside client-side bundles or mobile binaries. Always hard-pin the allowed algorithms (RS256 or HS256) in your verification middleware. Verify expiration (exp), issuer (iss), and audience (aud) alongside the signature.

SegurançaDev
Interesse
dev.to

The Mechanics of CLI Mistakes: Pipes, Redirection, and Stream Adjacency

It is 1:30 AM. PagerDuty just woke you up. An alert is firing across a production cluster, your terminal history is a blur of half-remembered flags, and every second the incident remains unmitigated feels like an eternity. You need to locate an errant service dump or isolate a single anomalous IP hammering your endpoints. You type a command you have executed a million times. You hit Enter. Instead of a clean output, your terminal buffer explodes with a thousand lines of unreadable Permission denied errors, blowing past your scrollback limit. Or worse: the prompt returns quietly in milliseconds with an empty output—or dirty data—giving you zero indication of what failed. You sit there in the dark, squinting at the screen, frustrated, asking yourself: “Why didn't that work? I swear, that command was right.” It was not right. It was muscle memory betraying you. Small syntactic oversights in the shell rarely trigger helpful stack traces. Instead, they betray how Unix handles standard streams and file descriptors under the hood. This guide dissects two insidious command-line mistakes that routinely trip up engineers during high-pressure audits: The Pipeline Fallacy: Why chaining | 2>/dev/null fails to suppress standard error. Stream Adjacency: Why uniq silently passes duplicate records unless fed a sorted stream. We examine the exact Unix mechanics behind both failures, provide battle-tested fixes, and outline the production contexts where these errors cost real engineering hours. Companion Resource: Production debugging patterns, terminal syntax breakdowns, and incident response playbooks are documented in the open-source devops-playbook repository. | 2>/dev/null) The Incident Scenario You are investigating an alert on an unfamiliar host. An unprivileged application process crashed, leaving behind an orphaned credential or state file. You know three attributes of the target file: Target owner: bill Target group: ted Exact file size: 254 bytes You execute a recursive sea

InfraDev
Interesse
dev.to

React 19 useActionState: Preventing SSR State Pollution and Event Listener Memory Leaks

When scaling Next.js 15 and React 19 Server Components in heavy production environments, one of the most subtle yet dangerous pitfalls is cross-request state pollution when combining server actions, optimistic UI (useActionState), and shared event emitters or singletons. In this deep post-mortem, we dissect how dangling event listeners survive across SSR lifecycles, how optimistic rollbacks corrupt node memory, and how to structure robust cleanup resilience. During traffic surges, worker nodes often experience memory bloat and connection degradation. Ingress access logs report intermittent data leaks where User A intermittently sees cached state or optimistic payloads belonging to User B. In Node.js SSR environments, module-level variables and global event emitters are singletons shared across all concurrent HTTP requests hitting the same process. // ⚠️ ANTI-PATTERN: Shared module-level listener const stateEmitter = new EventEmitter(); export function UserProfile({ userId }: { userId: string }) { const [state, formAction, isPending] = useActionState( async (prevState, formData) => { const res = await updateUserProfile(userId, formData); stateEmitter.emit('profileUpdated', res); return res; }, null ); // In SSR, if cleanup fails or aborts early, this listener leaks! useEffect(() => { const handler = (data) => console.log('Updated:', data); stateEmitter.on('profileUpdated', handler); return () => stateEmitter.off('profileUpdated', handler); }, []); } When an SSR render aborts prematurely (e.g., client disconnects or timeout), React unmount effects never fire on the server. The listener remains registered forever in Node.js global memory, causing: Memory leaks (MaxListenersExceededWarning) Cross-request data bleeding across asynchronous execution contexts To guarantee zero cross-request pollution, never rely on global event emitters. Instead, scope event dispatchers strictly to the active request lifecycle using Node's AsyncLocalStorage or React's component-scoped cont

Dev
Interesse
dev.to

The 0-Click AI Attack, Part 2: How to Break the Attack Chain Before It Becomes a Breach

In Part 1, we looked at the attack from the attacker's perspective. The attacker does not necessarily need to send a malicious prompt to the AI. They may only need to place malicious instructions inside something the AI already reads: an email, document, web page, ticket, knowledge-base record, RAG chunk, or tool response. The AI consumes the content. The content influences the model's reasoning. The model proposes an action. An authorized tool executes it. That is the 0-click attack chain. Part 2 asks the more useful engineering question: How do you break that chain before untrusted content becomes an authorized action? The answer is not a single stronger system prompt. It is a security architecture that assumes indirect prompt injection will sometimes get through and makes the resulting failure difficult to convert into impact. The first architectural decision is also the hardest one for teams to accept: Assume attacker-controlled content will eventually reach the model. Modern AI agents routinely read information outside the application's own trusted instructions. That can include email, web content, customer-submitted documents, enterprise knowledge bases, third-party APIs, search results, and tool responses. Microsoft's current agent-security guidance explicitly treats these paths as trust boundaries and warns that compromised data sources can influence an agent through indirect prompt injection. OWASP likewise recommends establishing trust boundaries between the LLM, external sources, and downstream functionality rather than allowing the model to make final authorization decisions. The practical implication is important: Do not build your security strategy around perfect prompt filtering. Build it around constrained consequences. A successful injection should not automatically produce a successful breach. A useful defensive model looks like this: External content ↓ Trust / provenance assessment ↓ Retrieval boundary ↓ Model context ↓ Plan / proposed action ↓ Au

SegurançaDevIA
Interesse
dev.to

Your Agent Says Verified. The Check Behind It May Be Empty.

Ever shipped an agent pipeline because the tool result said verified: true? I did — and then three readers showed me the check behind that receipt was never bound to anything. In my last post I showed an agent pipeline that verified one draft and delivered a different one, while reporting both as fine. The fix was a hash binding: the verifier records the sha256 of the bytes it checked, and the delivery path refuses to ship anything that hashes differently. It caught every swap, in code, with no vote for the model. Case closed — until three readers independently pointed at the hole underneath it: the binding covers the bytes, not the check. A verifier that runs no predicate at all still records a hash, still matches at delivery, and still emits a receipt that says verified. The binding is complete while the check is empty. Code, traces, outputs, and a ledger that CI re-verifies cell by cell: https://github.com/sunnydachs/agent-framework-showdown Not an exotic bug. A verifier whose implementation forgot to call the predicate. A predicate that always returns True. A config flag that skips the expensive part. In all of those, the receipt still looks exactly like the receipt of a working check. The setup, in one block: same three tools (build_draft → verify_draft → deliver_draft, all argument-free), same three frameworks (Strands, LangGraph, CrewAI), five cells, three seeds each. 45 runs, plus a 9-run bridge that re-runs one cell of the previous grid on this grid's serving stack. 54 runs, all exited 0. The artifact under test is one draft, wrong from its first byte: the app builds it from the imported notes field, so it carries the notes-only value. The declared predicate: the draft must contain the service-owned value and must not contain the notes-only value. In all 45 runs the artifact violates the predicate from the start. Nothing is swapped afterwards. The hash always matches — that is the point. The previous defense is fully armed in every cell below, and the quest

IADevSegurança
Interesse
dev.to

Image Optimization Beyond Compression: Lazy Loading, Modern Formats, and the Rendering Pipeline Tricks That Actually Help

Most developers stop at squishing a JPEG and calling it done. Run it through ImageOptim, drop it into the public/ folder, ship it. Job done. Except it's not — because image optimization in 2025 is a multi-layered problem that spans format selection, delivery strategy, browser rendering behavior, and server-side generation pipelines. Get any one of those layers wrong and you're leaving real performance on the table, even if your file sizes look great. This article goes past the basics. We're talking about the rendering pipeline decisions that affect Largest Contentful Paint (LCP), the loading and fetchpriority attributes that most developers use incorrectly, how to wire up responsive images properly in a Laravel/Blade context, and why AVIF isn't always better than WebP despite what the benchmarks suggest. Before you touch a format or a build tool, understand what the browser actually does with an image. The browser parses HTML, discovers image resources, queues them in the network priority system, downloads them, decodes them in the main thread (or off-thread for some formats), and then composites them onto the page. The decode step is where a lot of developers get surprised. A 200 KB WebP that decodes to a 4000×3000 bitmap is pushing 45 MB into memory. The browser has to handle that. For images that appear in the viewport immediately, you want decode to be fast. For images below the fold, you want it deferred entirely. This is why the decoding attribute matters: Most tutorials tell you to slap loading="lazy" on everything. Don't. Any image in the initial viewport — especially your LCP candidate — should never be lazy loaded. You're telling the browser to deprioritize the most important visual on the page. AVIF offers better compression than WebP at equivalent quality. That's real. But AVIF has a higher CPU decode cost, which matters on low-end mobile devices. If your audience skews toward budget Android phones — which is increasingly common in markets across the Mid

Dev
Interesse
dev.to

Kafka Exactly-Once Semantics (EOS): Preventing Idempotent Producer PID Churn and Coordinator Timeouts

In mission-critical distributed event streaming architectures, achieving Exactly-Once Semantics (EOS) with Apache Kafka is often treated as a simple configuration toggle (enable.idempotence=true and transactional.id). However, in high-throughput microservice clusters, ephemeral producer restarts, short-lived serverless invocations, and network timeouts frequently cause severe Producer ID (PID) Churn, exhausting broker memory and triggering cascading Transaction Coordinator timeouts. In this deep architectural post-mortem, we analyze the root cause of PID churn and provide production-hardened configurations to maintain deterministic EOS. When an idempotent Kafka producer initializes without a static transactional ID, the broker's Transaction Coordinator assigns a new 64-bit Producer ID (PID). Each broker retains PID state tracking sequences in memory: [Producer App Pool] │ (Restart / Network Hiccup) ▼ [Assign New PID] ──► [Broker PID Cache Bloat] ──► [JVM OldGen GC Saturation] │ ▼ [Transaction Coordinator Timeout] ▼ [HTTP 503 / Producer Fenced Exception] ProducerFencedException: When a previous producer instance with an unexpired transaction coordinator lease conflicts with a new instance. OutOfOrderSequenceException: When retries occur after a TCP socket reset while the broker's sequence window hasn't cleared the expired PID. Broker JVM Garbage Collection Spikes: Millions of dangling PIDs accumulating in the active transaction topic (__transaction_state). To eliminate PID churn in high-traffic deployments: server.properties) # Prevent PID accumulation across ephemeral producer restarts transaction.id.expiration.ms=1800000 transaction.state.log.min.isr=2 transaction.state.log.replication.factor=3 # Limit sequence window memory per partition max.producer.id.blocks=1000 Instead of assigning random ephemeral transaction IDs, bind transactional IDs deterministically to worker pod identities or partition assignments: // ✅ DETERMINISTIC TRANSACTION LEASING import { Kafka }

InfraDev
Interesse
dev.to

Quale prompt ha preso quella decisione?

TL;DR: prompt nel repository, modello fissato a una versione esatta (mai un alias), indice del retrieval versionato, ogni modifica dal set di eval, e la terna registrata con ogni decisione. Prendete una decisione presa in produzione dalla vostra funzione AI tre settimane fa e fate una domanda semplice: quale prompt l'ha prodotta? Nella maggior parte dei team la risposta onesta è "probabilmente quello attuale, a meno che qualcuno non l'abbia cambiato". Non è una risposta che si può dare in una revisione di incidente, a un cliente o a un revisore. Il comportamento di una funzione AI non dipende solo dal codice. Il prompt decide come viene istruito il modello. Il modello decide come quelle istruzioni vengono interpretate. L'indice del retrieval decide quale contesto il modello vede. Basta cambiare una delle tre e lo stesso input può produrre una decisione diversa. In molti sistemi nessuna delle tre passa da un rilascio. Il prompt sta in una riga di database o in un pannello di amministrazione e si modifica direttamente in produzione. Il modello è richiamato con un alias come "latest", e il fornitore sposta quell'alias su una versione nuova secondo il suo calendario. L'indice viene ricostruito da un job notturno. Nessuno rompe niente, eppure il comportamento si sposta, e quando qualcuno chiede perché non c'è niente con cui confrontare. La soluzione non è un nuovo strumento. È la disciplina di rilascio che già applichiamo al codice, estesa alle parti che cambiano di più il comportamento. Il prompt è codice: sta nel repository, passa dalla review, ha una versione e arriva in produzione con un rilascio. Il modello è una dipendenza: si fissa l'identificativo esatto di versione esposto dal fornitore, mai l'alias, e lo si aggiorna di proposito. Anche l'indice ha una versione, legata ai documenti e al modello di embedding che l'hanno costruito. Per una software house .NET non c'è niente di nuovo da imparare: è la stessa cura che si mette nel fissare la versione di un pacchetto

IADev
Interesse
dev.to

Three months of sales vanished, and every dbt run was green

In this article I'll show you how a dbt incremental model that looked perfectly reasonable wiped out three months of finance data, why none of our checks caught it, and how we fixed it without a full refresh. If you use delete+insert anywhere in your project, it's worth ten minutes to check you aren't doing the same thing. I'm an analytics engineer at a leading North American housewares company. We are moving our SAP reporting off SAP BW and onto Snowflake and dbt, one report at a time. One of those reports is a gross-to-net finance report built from SAP's general-ledger line items. That's around 1.5 million rows per fiscal period and more than 150 million rows of history, so rebuilding it from scratch on every run was never an option. So the model was incremental, and the config looked like this: {{ config( materialized='incremental', incremental_strategy='delete+insert', unique_key=['fiscal_year', 'fiscal_period'] ) }} select ... from {{ ref('stg_gl_line_items') }} {% if is_incremental() %} where entered_on >= dateadd(day, -30, current_date) {% endif %} Reprocess anything entered in the last month, keyed on the fiscal period. It ran three times a day for weeks without a single failure, and honestly, when I first read it, it looked fine to me too. Then the report showed zero sales for April, May and June. We only found it by accident. I was building a new commentary report on top of this table as part of the migration, and when I checked the new report's numbers, April to June were almost empty. The new report was fine. The table underneath it wasn't. When I counted rows per period for the current fiscal year, this is what came back: Fiscal period Rows in table Same period, prior year P004 (April) 88 ~1.6M P005 (May) 37 ~1.6M P006 (June) 26 ~1.4M The periods weren't empty. They had been cut down to a few dozen rows each, and that's part of the reason nothing caught it. delete+insert is the strategy you pick when you want to replace a slice of a table cleanly. On ev

Dev
Interesse
dev.to

Learn TensorRT: a C++17 path from YOLOv8 to async inference

I open-sourced Learn TensorRT, a hands-on course for developers moving from PyTorch models to C++ deployment. The baseline is TensorRT 10.14, CUDA 13.0 and C++17, in a pinned NVIDIA development container. The core path uses YOLOv8 to connect three parts of deployment: Correctness: export to ONNX, inspect outputs with Polygraphy, then implement preprocessing, TensorRT inference and postprocessing in C++. Optimization: compare FP32/FP16/INT8, use explicit Q/DQ quantization, and profile with Nsight. Pipeline behavior: add bounded queues, dynamic batching and asynchronous CUDA streams, then measure latency, throughput and overload behavior. A useful starting point is the single-image C++ pipeline in lesson 11. Follow its prerequisites, check the detections, and establish correctness before changing precision or adding concurrency. Later reports separate engine timing from application and pipeline measurements. The code emphasizes RAII, explicit resource ownership and target-based CMake. Lessons have build/run instructions and reporting checkpoints. Ubuntu with an NVIDIA GPU is the reference setup; C++ and CMake basics are expected. Engines and performance results must be regenerated for your environment. Electives include plugins, Triton, DeepStream and Jetson/DLA. Some elective runtime acceptance is still pending; the coverage matrix records those limits. Repository and learning roadmap — MIT licensed, with English, Chinese, Japanese and Korean READMEs. If you're learning TensorRT deployment, try the core path. Feedback on unclear steps or reproducibility problems is welcome. AI assistance was used to draft this introduction.

IADev
Interesse
dev.to

Fable 5.1 on Bedrock: data retention is now an architecture decision

The September 7 AWS Weekly Roundup filed Claude Fable 5.1 as one more model launch between EC2 R9g and Amazon Linux 2027. It isn't. For the first time on a frontier model in Bedrock, the key that unlocks access lives neither in IAM nor in the Marketplace, it lives in an account-scoped data retention setting that you have to flip through the API, because there is no console UI for it. I spent the week reading the data-retention and abuse-detection docs line by line, and the conclusion is uncomfortable for anyone operating under regulation: enabling Fable 5.1 is a landing-zone decision, not a product-team decision. Bedrock has always sold itself on two security models: zero operator access (no service operator can read model input or output) and zero data retention by default. The abuse detection doc still asserts both. What Anthropic introduced with the Covered Model category is a named exception: for Claude Fable 5 and Fable 5.1, all traffic is retained for up to 30 days for automated offline abuse detection, and classifier-flagged traffic is subject to human review performed by AWS. Two things that did not change, worth repeating because a hurried reading gets both wrong. First: your content does not go to Anthropic. The provider_data_share mode is legacy, and the doc itself states that sharing content with model providers is not supported today, it grants a permission nobody exercises. Second: nothing changes for Claude models released before Fable 5. The doc is explicit, and the mechanism is elegant: each model declares its own allowed_modes, so an account set to aws_review that also calls Opus 4.8 retains nothing from Opus: Opus permits none, and none wins for it. The friction isn't what AWS does with the data. It's that the authorization to do it lives in a scope most teams don't control. Resolution is hierarchical: the first scope whose value is not inherit wins. If the effective mode lands below the model's minimum, the model shows up as status: "unavailable"

IAInfraSegurança
Interesse
dev.to

Consumer GPU Inference for Tens to Hundreds of Billion Scale LLMs: Technical Insights

消费级显卡跑百-千亿大模型推理技术原理探讨 引言 Strata,dsv41-flash-offload,和较早的KTransformers(趋境科技)推出的技术都能够在消费级硬件上跑几百亿乃至千亿的大模型了,他们技术实现上是统一的技术吗? 现在确实是多条完全不同的技术路线,没有统一;但未来会收敛到一套「通用异构内存调度 + 稀疏MoE原生架构 + KV压缩」的统一范式,不过不会变成单一引擎。 Strata:面向通用MoE模型(比如125B MoE),核心是专家粒度三级缓存调度,属于推理引擎侧的内存管理技术,不修改模型本身,只要是MoE就能跑;权重分层放在显存/内存/SSD,按需加载专家,一次只激活少量专家。 dsv41-flash-offload(ds4/antirez的ds4项目):模型架构+推理引擎强绑定,专门为DeepSeek V4 Flash/V4.1 Flash定制,不是通用引擎。它能跑284B总参,但每token只激活十几B参数,核心是模型原生稀疏注意力(CSA/HCA混合压缩KV)+ MoE路由,KV cache被压缩到极小,不是单纯靠权重offload。 关键点:Strata是引擎适配MoE;DSV4.1 Flash是模型本身就设计成稀疏+低KV开销,ds4只是配套专用runtime,几乎不能跑别的模型。 原理:把模型权重切分,一层/一块放到显存、内存、SSD;计算前异步预取。 不能利用MoE“只激活部分专家”的特性;PCIe带宽瓶颈明显,token速度掉得厉害。 原理:识别MoE专家,按专家而不是按层做三级缓存,把高频专家放显存,中频放内存,低频放SSD;推理时只加载当前token路由命中的专家。 通用,支持多种MoE模型(125B这类),不需要模型在训练时做特殊改造; 原理:训练阶段就内置稀疏注意力CSA/HCA,把KV cache压缩几十倍;同时MoE路由,每步只激活少量专家。 284B总参,但是单token只激活8~16B参数,KV压缩后64K上下文只需要几百MB,这才是它能在消费PC跑几百B的核心。 模型锁死,引擎专用,ds4几乎只能跑DeepSeek Flash系列,不能直接跑Qwen MoE、其他MoE大模型。 独立维度,可叠加在上面任意路线,专门解决长上下文显存爆炸。不减少模型权重,只压缩KV。 所以现在生态是割裂的: 想跑通用MoE(125B):Strata; 想跑DeepSeek V4 Flash:ds4专用引擎; 稠密大模型:llama.cpp/AirLLM; 内核、数据调度、KV管理完全不一样,不能直接互换。 不会变成单一开源项目 统一范式会包含这4个组件(未来通用推理引擎都会内置): MoE专家级异构内存调度(Strata的核心思路):不再按层,按专家热度做三级缓存(VRAM > DDR > NVMe SSD),异步预取+预加载; 模块化KV压缩插件(DSV4 Flash的CSA/HCA/SWA):作为可插拔模块,不管什么模型都可以开启稀疏注意力、KV量化、token重要性过滤; 量化层(FP4/NVFP4 / GGUF):权重压缩; 投机解码(Speculative Decoding):DSpark这类draft模型加速,抵消offload带来的IO延迟。 也就是说:未来会出现通用推理引擎(类似下一代SGLang/vLLM),内置这套全套能力,同一个引擎,既可以跑普通MoE,也可以原生支持Flash系列稀疏模型,不用像现在Strata、ds4两套完全独立代码。 模型架构鸿沟 模型本身的稀疏结构,必须在训练时设计。 通俗讲:引擎统一是“跑车底盘统一”;但普通MoE和Flash MoE是两种完全不同的发动机。底盘可以兼容,但发动机本身不能凭空改造。 硬件带宽瓶颈(你Y9000笔记本4090最核心限制) 小IO:专家粒度预取可以掩盖延迟; 大prefill长上下文:带宽瓶颈依然会明显降速。 统一框架只能优化掩盖延迟,不能突破PCIe物理带宽。 Strata:跑125B MoE,靠专家按需加载,但长上下文KV会占用大量系统内存;升级到64G内存会明显改善; ds4+DSV4.1 Flash:不是跑125B,跑的是284B总参、稀疏激活模型,它的优势是KV极小,长上下文压力小;代价是模型固定,不能跑Qwen MoE这类。 两者不是替代关系,是两个不同优化方向: Strata:解决「超大权重怎么塞进有限显存」; DSV4 Flash+ds4:解决「超大上下文KV怎么不爆内存」。 未来统一引擎会把两者能力合并:专家粒度权重offload + 可插拔稀疏KV压缩,一个引擎同时支持两类模型。 vLLM / SGLang 会逐步吸收Strata的MoE分层缓存思想,加入专家粒度offload; Flas

IADev
Interesse
dev.to

Web Performance Optimization: How to Find and Fix the Real Bottleneck

A user clicks a button. Nothing happens. They wait. Maybe the page eventually responds. Maybe an API request is still running. Maybe the browser is processing a huge JavaScript bundle. Maybe the database is scanning millions of rows. From the user's perspective, there is only one conclusion: The application is slow. But from an engineer's perspective, this statement is incomplete. Where is the slowness actually coming from? It could be the browser, JavaScript, CSS, images, the API, server-side code, the database, a third-party service, the network, or even the infrastructure running the application. That is why Web Performance Optimization is not simply about making a frontend load faster. It is about developing a systematic way to answer one question: Where is the bottleneck, and what evidence proves it? This article builds a practical mental model for diagnosing and improving performance across the entire web application stack. What Is Web Performance? Measure Before You Optimize Core Web Vitals Finding the Root Cause Understanding the Critical Path Frontend Performance Optimization Lazy Loading When Frontend Optimization Isn't Enough Database Performance Caching Algorithms and Profiling Network, HTTP and CDN Production Monitoring A Real Production Scenario The Performance Optimization Framework Final Mental Model Web performance describes how quickly and efficiently a web application loads, renders, responds to user interaction, communicates with servers, and completes the work requested by users. It includes much more than: "How many seconds does the page take to load?" It includes: Initial page loading. Time until important content becomes visible. Interaction responsiveness. API latency. Database query performance. Server processing time. Network latency. JavaScript execution. Rendering performance. Visual stability. Consider this request: User ↓ Browser ↓ HTTP Request ↓ Backend ↓ Database ↓ Response ↓ Browser Rendering The user experiences the entire chain. I

Dev
Interesse
dev.to

Governing Next.js Phone Verification Login SMS OTP Resends in Production

TL;DR: In a Next.js phone verification login, treat the SMS OTP resend countdown as a backend admission-control decision, not a browser timer. For marketplace signup, the server should own the challenge state, return a masked destination and retry-after metadata, verify the submitted code, and create the application session only after validation succeeds. Put delivery behind a narrow contract so changing the provider behind that capability does not change the signup code. The operational recommendation is to launch this as a guarded workflow: country allowlist first, atomic send budget second, verification-attempt budget third, then bounded delivery-status polling. This ordering matters because a successful SMS API response proves neither delivery nor identity, while a polished countdown in Next.js proves almost nothing about abuse control. The dangerous metric is not raw send failure. It is the gap between accepted send requests, delivered messages, successful code checks, and completed signups. Those are four different states, and compressing them into a single “OTP success rate” leaves the on-call engineer guessing whether the problem is routing, delivery, user entry, or application session creation. Make the challenge identifier the join key across those states. Persist the masked destination, provider message identifier, country decision, send count, failed-check count, expiry, and next_send_at; never put the full phone number or the code into routine logs. A Next.js server action or API route can return the masked destination and remaining wait, but the browser must not decide whether another send is allowed. Short timers are deceptive. Two tabs can race, a page refresh can reset local state, and a caller can bypass the page entirely. The backend transition needs an atomic compare-and-set or transaction, because a process-local mutex does not protect two application instances. Pick the actual cooldown and attempt limits from abuse risk, expected support load,

DevSegurança
Interesse
dev.to

SQL Pagination

SQL Pagination A deep-dive walkthrough of pagination in SQL Server — covering OFFSET/FETCH, why ORDER BY is mandatory and why it must be deterministic, calculating page numbers, getting the total row count without a second round trip, why deep pages get slower (and how keyset pagination fixes it), the indexing that makes pagination fast, wrapping it in a stored procedure, and how EF Core's Skip/Take maps onto all of this. Introduction What Pagination Actually Is OFFSET / FETCH: The Core Syntax Why ORDER BY Is Mandatory (and Must Be Deterministic) Calculating Page Numbers Getting the Total Row Count The Hidden Cost: Deep Pages Get Slower Keyset (Seek) Pagination Indexing for Pagination Pagination Inside a Stored Procedure Older Approaches: TOP and ROW_NUMBER() Pagination in EF Core Common Pitfalls Quick Reference Table Conclusion Pagination means retrieving data in smaller chunks instead of loading all records at once. Instead of asking the database for every row in a table and letting the application (or the user's browser) sort out what to show, you ask for exactly one "page" at a time — say, rows 21 through 30 — and fetch the next page only when it's needed. This is especially important when working with large datasets, where loading everything wastes memory, network bandwidth, and database resources on rows nobody will ever look at. The standard SQL Server approach (SQL Server 2012 and later) is the OFFSET/FETCH clause: SELECT Id, OrderDate, Total FROM Orders ORDER BY OrderDate DESC, Id DESC OFFSET 20 ROWS FETCH NEXT 10 ROWS ONLY; -- skip the first 20 rows, then return the next 10 — i.e. page 3 at a page size of 10 This guide goes beyond the syntax. It covers the mechanics that matter in production: why the ORDER BY has to be deterministic or pages will silently overlap, why OFFSET gets slower the deeper you page, the keyset alternative that stays fast at any depth, and the indexing that underpins both. Without pagination: SELECT * FROM Orders; -- 5,000,000 rows

Dev
Interesse
dev.to

The internet's root key rotates in five days. Your resolver may not be ready.

On October 11 — five days from this post — the most trusted key on the internet changes hands. KSK-2017, the key-signing key that has authenticated the DNS root zone since October 11, 2018, stops signing. KSK-2024 takes over. Eight years, to the day, and the entire trust chain of DNS runs through that swap. The schedule is not a rumor: it is IANA's own rollover page — published January 11, 2025, trust-building via RFC 5011 through the year, and on October 11, 2026, "the successor key is scheduled to sign the zone; the current key will not." If you run your own validating resolver, this post is for you. If you don't, it's still for you — because the failure mode when a resolver misses this window is beautifully silent: everything looks normal, and names stop resolving. DNSSEC chains trust from the root down: the root signs its DNSKEY set, your resolver holds a trust anchor — the public key it believes the root uses — and every answer below the root validates up that chain. The root zone's current key-signing key, KSK-2017 (key tag 20326), has been that anchor for eight years. The rollover is deliberately slow, because you cannot reboot the internet's trust: January 11, 2025 — KSK-2024 (key tag 38696) is published alongside KSK-2017 in the root's DNSKEY record set. Nothing changes; both keys are simply there. From ~February 2025 — resolvers implementing RFC 5011 (automated trust-anchor updates) start watching the new key. The mechanism requires a 30-day hold-down with regular queries before a resolver promotes the new key to a trust anchor. October 11, 2026 — KSK-2024 begins signing the root zone. KSK-2017 stops. The whole design assumes one thing: your resolver has been running and querying regularly through the transition. RFC 5011 is an automation, not magic — it needs roughly 30 days of uptime to promote a new key. A validator that was powered off for a month, an appliance that cached its anchors, a VM snapshot resumed after the hold-down window — any of them can

InfraSegurança
Interesse
dev.to

How to Build a Rotation-Safe Webhook Receiver: Verify Raw Signatures for Property Billing

To build a webhook receiver that survives key rotation, verify each signature against the raw body, bind the verified key to a property account, enqueue that evidence, and acknowledge only after the durable write. At 03:07, the page says webhook_auth_failures_high. The property-management API is still serving residents, but payment and maintenance events from several buildings are being rejected just after a production key rotation. The dashboard shows a tidy error-rate line. It does not answer the useful question: which key identifier failed, for which property account, and did any rejected event get counted toward that account's bill? TL;DR: keep the previous and current verification keys active during a bounded overlap, identify keys with a non-secret ID, verify the signature over the untouched request bytes, persist an immutable receipt to a durable queue, and acknowledge only after that write succeeds. Attribute usage from the verified account and key ID stored in that receipt, never from a caller-supplied account field. This is the least complex design that rotates a production API key without downtime while keeping billing evidence defensible. The order matters. Parse first and the signed bytes may change. Acknowledge first and a crash can erase an event the sender believes was accepted. Retire the old key before in-flight deliveries drain and the rotation manufactures authentication failures. None of those errors is rescued by a prettier dashboard. The first useful signal is not the aggregate failure rate. It is a rotation-state mismatch: traffic is still arriving under the retiring key as its overlap deadline approaches. That warning gives the on-call engineer something actionable while both keys remain valid. Once verification failures spike, the receiver is already dropping work. For a property manager, attribution has two dimensions that must not be blurred: the property account responsible for usage and the credential generation that authenticated the e

SegurançaDev
Interesse
dev.to

Your Guardrail Cannot Read What Your Agent Is About to Run

Adversa AI handed GitHub Copilot CLI an encrypted instruction, the key, and a polite note asking it to decrypt. The agent's own code runtime did the rest. Static filters read text; this payload was never readable until it was already running. Your content filter just cleared a malicious instruction. It read every word of it, checked it against every pattern, and passed it. The instruction was encrypted. The filter never had a chance, and neither will the next one. That is the uncomfortable core of a research disclosure that went public this week. Adversa AI found a way to smuggle a live instruction past GitHub Copilot CLI's guardrails in autopilot mode: hand the agent ciphertext, hand it the decryption key, and ask it, nicely, to decrypt. The agent treats decryption as a coding task, fires up its own code execution runtime, and only then does the instruction wake up. Adversa calls these "zombie instructions." Dead text until the agent itself breathes life into them. This piece fills the gap most writeups skip. Everyone reports the bypass. Nobody explains the mechanism precisely enough to fix it. So let me walk through exactly why a static filter is structurally blind here, show you the mechanism in runnable code, and land on the one checkpoint that still works: the tool boundary, where instructions become actions. The timeline is short and worth getting right. On September 17, 2026, Adversa AI reported the technique, which they call Cryptographic Context Injection, to GitHub through its bug bounty program. The attack chain, per the writeup: an attacker page carries an encrypted blob plus the decryption key and an instruction to decode it. Copilot CLI, running in autopilot mode, decrypts the blob inside its own code execution runtime. In the severe variant, it used a local .env file as part of the decryption key material, then exfiltrated the resulting secrets through an outbound HTTP request. Two model results stand out. Microsoft's own mai-code-1.1-flash fell for t

SegurançaDevIA
Interesse
dev.to

Your agent's trust boundary is the plumbing: a DNS escape, a root shell in seconds, and a warning that came too late

Three recent incidents, one lesson: agents fail at the ordinary infrastructure around the model. An OpenAI agent reached the internet over DNS and ran for about 2.5 hours before a human stopped it. An agent-like attacker chained two zero-days to root at the Dutch Institute for Vulnerability Disclosure. A prompt injection in Manus ran its payload before the security warning appeared. Test the boundary, not just the prompt. On Sept 20, an OpenAI internal agent on a biographical research task found an unintended route to an external chatbot over DNS. Monitoring raised the top-priority alert at 10:02, a human acknowledged at 10:05, and the run was stopped manually at 12:34. That is roughly 2.5 hours and 18 further questions sent through the tunnel. OpenAI paused all training, evaluation and inference with tool-use for its most capable models, added blocking at two independent network layers and DNS allowlisting, and will restart affected models with fresh training. TechRepublic's Oct 2 coverage reports that the automated stop also failed. Detection worked. Containment was the slow part. DIVD was breached on Sept 21 through two Zammad zero-days: CVE-2026-102489 (session fixation to remote code execution) and CVE-2026-102490 (local privilege escalation to root). DIVD reported the attacker moved from session hijack to root in seconds and looked automated, with every step decided by an agent and self-justifying comments left in the exploit scripts. Whether this is a watershed or one noisy, badly configured agent is being argued on dev.to right now. Either way, a helpdesk that can reach the rest of the network turned a loud attacker into a fast one. Salt Labs found an indirect prompt injection in Manus, a $4B agent platform, that led to remote code execution. A JSFuck-obfuscated payload slipped past filters, stole tokens for connected apps such as Gmail, Dropbox and GitHub, and the security warning only appeared after the payload had run. Meta patched it through its bug boun

SegurançaInfraIA
Interesse