If you’re automating design workflows with AI agents, your .svg files might be lying to you. The PerfectVector team dropped a critical warning on November 16: a file extension doesn’t guarantee vector art. Many agent-generated files are just bitmaps wrapped in an tag. They render fine in browsers, but when you send them to a laser cutter or print shop, you’re stuck with a pixelated mess that can’t be edited. There are no shapes to tweak because there never were any.

The 20-Line Reality Check

To combat this, PerfectVector released a lightweight audit script using only Python’s standard library. It’s not a full validator, but it’s a solid first line of defense. The script parses the XML, counts actual shape elements like , , and , and flags any tags pointing to raster data URIs or common bitmap extensions like .png or .jpg. If it sees raster data and zero shapes, it screams 'FAKE.' If it sees mixed content, it marks it 'MIXED.' This heuristic approach catches the most common agent failure mode: lazily embedding a screenshot instead of generating geometry. The team tested their script on three distinct files. The first, 'fake.svg,' was a 256×256 PNG base64-embedded in an tag. The audit correctly flagged it as 'FAKE (bitmap inside)' with zero shapes and one raster image. The second, 'handcoded.svg,' contained a simple and , passing as 'vector.' The third, a real API test sample, contained five shapes and four path commands, also passing as 'vector.' They cross-referenced these results with svgpathtools’ svg2paths, which confirmed the shape counts, proving the simple script aligns with more complex parsing libraries.

Known Blind Spots in Heuristics

However, zero-cool knows that no script is perfect. The audit misses references without explicit raster extensions, shapes imported via tags from external files, and bitmaps hidden in CSS background-images. It also struggles with 'bad traces'—real vectors that are so poorly traced they consist of thousands of tiny, useless paths. An empty SVG might even get a 'vector' label despite having no artwork. The verdict 'vector' simply means 'no bitmap found,' not 'this file is useful for cutting.' Always count nodes manually if precision matters.

The Agent’s Dilemma: Code vs. Trace

This highlights a core friction point in agentic design. For simple geometry, agents can write SVG code directly, passing the audit easily. But for logos or photos, they need a tracer. If you’re wiring an agent to a tracing tool via MCP, you must audit the output, regardless of the tool’s reputation. As PerfectVector noted in a previous post, 'Claude Can Write SVG. That Doesn’t Mean It Vectorized Your PNG.' Agents often confuse the ability to write syntax with the ability to generate semantic vector data.

Key Takeaways

  • File extensions are a lie: .svg files can contain embedded bitmaps that are uneditable.
  • Use the 20-line Python audit script to flag raster-wrapped SVGs before production.
  • 'Vector' verdict only means no bitmap was found; check for node counts and trace quality.
  • Always audit output from agent-connected tracing tools, even if the agent wrote the SVG code itself.

The Bottom Line

Stop trusting your agent’s file extensions. If you aren’t auditing the XML structure, you’re shipping junk to your production line. Verify the geometry, or get out of the way.