SShortSingh.
Back to feed

A2UI in Angular: Zod Schemas Form the Trust Boundary for Agent-Built UIs

0
·10 views

A developer explains how the A2UI protocol lets an AI agent assemble user interfaces in an Angular app without sending HTML or executable code. Instead, the agent describes UIs using components from a catalog the developer defines. Each component is specified by a Zod schema that the model reads, the agent uses to validate its output, and the Angular component is typed against. The article walks through a support-ticket demo, including a PriorityBadge component that restricts priority to four values, allows data bindings, and rejects unknown props. The author notes the demo pins A2UI v0.9 packages, since the 1.0 specification was announced in November with mostly renamed wire-level fields. The catalog serves as the contract between the app's renderer and the agent, which can only respond with components from catalogs the app declares support for.

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 ·

FSCSS 1.2.3 Adds Derived Arrays for Reusing Method Output as Collections

FSCSS array methods such as .reverse, .list, and .length return strings rather than array objects, and they cannot be chained. Version 1.2.3 introduces derived arrays, where a new @arr declaration takes a method's output and resolves it into a proper array that can be indexed, looped over, and derived from again. The approach is illustrated with examples such as reversing a color list, building 1-based index sequences sized to a source array, and appending items with the mutation operator. The guidance recommends declaring a new array step whenever a result needs to be reused, since chaining is unsupported. The author notes that derived arrays add no new runtime type but make method results dependable for practical module patterns.

0
ProgrammingDEV Community ·

Hardening Local Reverse Proxies for AI Agent Sidecars and MCP Tools

Developers running MCP servers, local vector databases, and AI coding agents often expose many localhost services through reverse proxies such as Nginx, Caddy, or Traefik. A common docker-compose mistake maps ports to 0.0.0.0, which lets any device on the same local network reach internal agent tooling. Binding explicitly to 127.0.0.1 closes that exposure. The article also warns of DNS rebinding attacks, where a malicious site can use a rebound DNS record to make a browser send requests to local endpoints, and recommends strict Host header whitelisting as a defense. Blocking path traversal and access to sensitive dotfiles at the proxy layer is also advised.

0
ProgrammingDEV Community ·

Storing Money in Code: Integer Cents Versus Decimal Types

This lecture is aimed at developers who need to store prices, total carts, split bills, or convert currencies without losing a cent. It demonstrates that binary floating-point errors corrupt amounts: int(19.99 * 100) yields 1998 instead of 1999, and the same flaw appears in JavaScript and SQLite. The recommended approach is to store amounts as integer counts of each currency's minor unit, such as 1999 for 19.99 USD, which keeps arithmetic exact across languages and databases. Because minor-unit counts differ by currency (JPY and KRW have none, USD and EUR have two, BHD has three), the author found that locale formatters and runtime libraries disagree, so developers should maintain their own currency table. A small Python converter is provided that parses text with Decimal and rejects input with more decimal places than the currency allows.

0
ProgrammingDEV Community ·

AI-Suggested npm Package Didn't Exist, Exposing 'Slopsquatting' Risk

AI assistants sometimes recommend installable packages that do not exist, and attackers can exploit this by registering those names and publishing malicious code. This practice, called slopsquatting, was seen with a fabricated package named react-codeshift, which appeared in over 200 GitHub files after AI-generated instructions cited it. Security researcher Charlie Eriksen of Aikido registered the name first on January 14, 2026, as a harmless placeholder, though it still draws dozens of downloads weekly. The article demonstrates that npm lifecycle scripts like postinstall can execute automatically during installation, even without importing the package. It recommends checking a package's existence, age, and download count in the registry before installing anything an AI suggests.