AWS Builder Center
From Vibe Coding to Verified Security: Building TraceGuard and Designing Its AWS Architecture

From Vibe Coding to Verified Security: Building TraceGuard and Designing Its AWS Architecture

Vibe coding helps developers build faster—but security can fall behind. Discover how TraceGuard combines real security scanners, isolated runtime testing, and AI-powered guidance to uncover risks, and explore its proposed AWS architecture using EC2, cross-account VPC peering, and a separate failover strategy.

AI Engineer
A developer describes an application in a prompt. Minutes later, they have a working interface, authentication screens, API routes, and a database connection.
That speed is exciting.
But a working application is not necessarily a secure application.
The login page might look complete while the backend accepts unauthenticated requests. A generated dependency file might contain vulnerable packages. A configuration file might accidentally expose a credential. An application might build successfully while handling unexpected input poorly.
AI-assisted development—often called vibe coding—makes it easier to create software. It does not remove the responsibility to understand, test, and secure that software.
We built  TraceGuard  to help developers close that gap.
 TraceGuard  takes an authorized repository, collects evidence from multiple security scanners, performs supported runtime checks in isolated containers, and turns the results into explanations developers can act on.
This article covers what we built, what we learned from running real scans, and how we would bring the platform to AWS using Amazon EC2, isolated worker environments, durable queues, and a cross-account recovery design.
The AWS architecture described here is a deployment blueprint. It is not a claim that we have already completed production deployment or disaster-recovery testing.

The problem: shipping faster than we can review

For many builders, the development loop has become:
  1. Describe a feature.
  1. Generate the implementation.
  1. Check that the application runs.
  1. Move to the next feature.
Security often enters the conversation only after something goes wrong.
The challenge is not simply a lack of scanners. Developers can already choose from many tools. The difficulty is connecting the output to a practical decision:
  • Is this an actual vulnerability or a suspicious pattern?
  • Which file should I inspect?
  • Did multiple tools observe the same issue?
  • Was the application tested at runtime?
  • What should I fix first?
  • How can I prove the fix worked?
TraceGuard brings those questions into one workflow.
Our goal is to make security review part of building an application, rather than a separate activity that developers postpone until deployment.

What TraceGuard does today

Try it yourself:  Explore TraceGuard .
The current implementation starts with an authorized public GitHub repository and records the commit being analyzed.
It then runs independent tools against that repository:
Tool
Role in the scan
Semgrep
Detect potentially unsafe source-code patterns
CodeQL
Analyze supported source languages and query code relationships
Joern
Build a code property graph and run configured data-flow queries
Gitleaks
Identify potential exposed credentials
OSV Scanner
Identify known vulnerabilities in dependencies
Trivy
Inspect supported dependencies and configuration issues
Supported runtime checks run inside disposable Docker environments.
For Flask and FastAPI applications, the platform can establish HTTP baselines and perform bounded input variations. For supported root-level Vite applications, it can prepare dependencies, build the application, and check the preview server.
Those checks have limits. An HTTP response from a Vite preview server does not prove that every browser interaction works, and a successful scan does not prove that an application has no vulnerabilities.
TraceGuard keeps those distinctions visible.
Each sensor reports its status, findings count, execution time, and worker image. A failed scanner remains a failed scanner—it is not converted into a clean result.
The application also includes authenticated, user-scoped scan access, an assistant that explains saved findings, and AI-generated PDF reports.

A real integration lesson: the scanner must understand the repository

One of our most useful lessons came from scanning a React/Vite repository.
The initial pipeline had too many Python-specific assumptions.
Semgrep was configured with Python rules. CodeQL attempted to create a Python database. Runtime testing expected Flask or FastAPI.
Some tools completed, but that did not mean the repository had received appropriate coverage.
We corrected the pipeline to detect JavaScript and TypeScript source files, provisioned the JavaScript CodeQL query pack, updated the Semgrep configuration, and added an isolated Vite build-and-HTTP workflow.
After those changes, a real scan completed with all six scanners and both runtime passes. The final report contained seven correlated findings.
That result taught us an important engineering lesson:
A green status is useful only when the tool was configured to analyze the application in front of it.
This also influences the AWS design. Worker provisioning, image availability, language selection, and execution limits need to be explicit parts of the platform—not assumptions hidden inside a server.

Why AWS fits the next stage

Running TraceGuard locally helped us validate the product workflow.
Running it as a service introduces a different set of responsibilities.
Repository analysis can be CPU-intensive. Different scanners have different memory requirements. Jobs can take several minutes. Workers can fail. Submitted application code must remain isolated from the platform’s credentials and control systems.
Our proposed AWS architecture separates these responsibilities:
Responsibility
Proposed AWS component
Serve the frontend
Amazon S3 and Amazon CloudFront
Run the API and trusted orchestration services
Amazon EC2 behind an Application Load Balancer
Execute scanner workloads
Dedicated EC2 worker groups
Store versioned worker images
Amazon ECR
Queue scan jobs
Amazon SQS
Store reports and scan artifacts
Amazon S3
Manage service credentials
AWS Secrets Manager
Collect operational signals
Amazon CloudWatch
Route users during recovery
Amazon Route 53
Connect selected private services across accounts
Amazon VPC peering
This separation would let us scale the expensive scanning workload independently from the user-facing application.
It would also give us clearer boundaries around sensitive operations.

EC2: separating orchestration from execution

Our proposed EC2 deployment has two distinct roles.
The control plane handles authenticated requests, checks ownership, accepts scan jobs, tracks progress, and serves results.
The worker plane performs repository analysis.
These should not become one unrestricted environment.
A scanner worker processes material that we do not fully trust. A runtime worker may execute application code from the submitted repository. That environment should not inherit the API server’s credentials or access to unrelated users’ data.
For the AWS deployment, we would give workers narrowly scoped permissions and keep target execution environments separate from the trusted process that coordinates them.
The current Docker restrictions are a starting point: non-root execution, resource limits, disposable workspaces, restricted privileges, and disabled networking during target runtime checks.
They are not a substitute for a production isolation review.
For higher-risk workloads, we would evaluate stronger isolation, including separate disposable compute environments. We would also explicitly prevent submitted applications from accessing instance credentials or the orchestration service’s Docker socket.
The principle is straightforward: a repository scan should have access only to what that scan needs.

Durable jobs with Amazon SQS

The current application uses a process-local job queue. That is useful for development, but it is not enough for a service expected to survive process or instance failures.
Our AWS design would move scan dispatch to Amazon SQS.
The API would create a durable job record and enqueue a message containing a scan identifier and the information needed to retrieve its inputs.
A worker would receive the message, claim the job, run the configured sensors, and persist the result.
SQS visibility timeouts allow a message to become available again if a worker does not finish and delete it. Standard queues can also deliver messages more than once, so the application must handle duplicate delivery safely.  Amazon SQS visibility timeout documentation 
For TraceGuard, that means designing an explicit job state machine.
We would track:
  • The immutable repository commit.
  • The worker attempt and lease.
  • Completed sensor stages.
  • Artifact locations.
  • Whether a final result has already been committed.
A retry should not blindly create duplicate findings or overwrite a newer result.
For long-running scans, workers would extend the visibility timeout while they remain healthy. Repeatedly failing jobs would eventually move to a dead-letter queue for investigation.
This would allow recovery from a failed worker without treating an interrupted scan as a completed assessment.

Cross-account architecture and VPC peering

We also want an architecture that can recover when the primary environment becomes unavailable.
A proposed arrangement uses two AWS accounts:
Account
Intended responsibility
Primary account
Normal API traffic and scanner execution
Recovery account
Independently provisioned standby services and recovery capacity
For illustration, the VPC address ranges could be:
  • Primary VPC:  10.10.0.0/16 
  • Recovery VPC:  10.20.0.0/16 
These are example ranges, not deployed resources.
A cross-account VPC peering connection could provide private connectivity between selected services in those VPCs. Establishing the connection alone is insufficient: routing and security rules must also permit the intended traffic. The VPC address ranges must not overlap, and VPC peering does not provide transitive routing.  AWS VPC peering documentation 
We would use that connectivity selectively.
For example, an internal recovery service might need to communicate with a private coordination endpoint during a controlled migration or recovery exercise.
We would not open every subnet to every service.
The route tables, destination ports, and security rules should reflect a specific application requirement. Connectivity between accounts should be deliberate and reviewable.
Most importantly, VPC peering is not the failover mechanism.
It does not replicate a database, replace an EC2 instance, redirect public traffic, or make a standby application ready to accept users.

What happens if an EC2 instance fails?

We would handle failures at different levels.
An individual worker failure should be handled by job recovery. The unfinished job becomes eligible for another worker, and persisted state determines what must run again.
An API instance failure should normally be handled inside the primary environment through load balancing and replacement capacity.
A larger primary-environment failure may require the recovery account.
For that recovery path, we would need more than a second EC2 instance:
  1. A compatible application version in the recovery environment.
  1. Available scanner images.
  1. Correctly configured secrets and permissions.
  1. Accessible job and report data.
  1. A tested database recovery strategy.
  1. A decision about when the standby environment may accept writes.
  1. Traffic routing that directs users to the healthy environment.
Amazon Route 53 supports health-check-based DNS failover. Its recovery controls can participate in routing traffic away from an unhealthy endpoint, but the application and its dependencies still need to be ready to serve that traffic.  Route 53 health checks and DNS failover 
DNS-based recovery is not instantaneous for every client. Resolver caching and existing connections affect what users experience.
We would therefore describe recovery in terms of measured recovery objectives, not promise “zero downtime.”

Avoiding a standby that depends on the failed primary

A recovery environment can look independent while still depending on the primary account for critical resources.
For example:
  • Its only usable secrets might live in the primary account.
  • It might consume only the primary environment’s queue.
  • It might need to fetch worker images from an unavailable registry.
  • Its application might have no usable access to the database.
That would weaken the recovery design.
For TraceGuard, we would define which dependencies are shared, which are independently provisioned, and which are replicated.
The existing MongoDB deployment also needs its own recovery plan. Adding VPC peering does not make an externally hosted database highly available, nor does it establish private database connectivity automatically.
We would also need a mechanism to prevent both environments from processing the same job or accepting conflicting writes during recovery.
The cross-account design is therefore a resilience project, not just a networking configuration.

Where AI belongs

TraceGuard uses AI to explain collected evidence and help developers plan remediation.
The scanners remain the source of the observations.
The current configured provider is Azure Foundry. An AWS-native evolution could add Amazon Bedrock as another provider, but that integration should be implemented and tested before we claim to use it.
Regardless of provider, the responsibilities remain the same:
  • Send relevant evidence rather than unrelated repository content.
  • Treat repository text as untrusted input.
  • Keep private credentials out of prompts.
  • Distinguish generated guidance from verified results.
  • Report provider failures honestly.
We also added an assistant that can answer questions about a selected scan or finding.
A developer can ask why a finding matters, what to change, and how to verify the result. The assistant does not silently apply those changes.
That boundary matters because plausible remediation advice is not the same as a passing regression test.

Reports developers can act on

A downloadable report should be more useful than a raw JSON file.
TraceGuard’s PDF workflow combines an AI-generated assessment with the recorded scan details.
The report includes repository and commit information, scanner coverage, findings, evidence, remediation guidance, proposed tests, verification results, and limitations.
In the AWS design, we would store completed reports in private S3 storage and authorize access through the application.
The download path must preserve the same ownership checks as the scan API. A report identifier should never become a shortcut around user-level access controls.
We would also apply retention rules so temporary source snapshots and old artifacts do not remain indefinitely.

Operating the platform on AWS

A production security platform needs visibility into its own failures.
For TraceGuard, useful operational signals include queue age, scan duration, worker memory failures, scanner error rates, AI request failures, and PDF-generation latency.
We would send those signals to CloudWatch and use them to distinguish several very different situations:
  • A repository genuinely has no matches.
  • A scanner could not run.
  • A worker ran out of resources.
  • A dependency registry was unavailable.
  • AI explanation generation failed after the scanners succeeded.
Those states should produce different user messages and different operational responses.
Cost controls also belong in this design.
We would measure scanner resource usage, scale workers based on demand, clean up temporary artifacts, and avoid repeatedly generating identical AI explanations where the evidence has not changed.
Any use of interruptible capacity would require jobs that can tolerate interruption and retry safely.

What we would validate before calling this production-ready

Before describing the AWS architecture as deployed and resilient, we would run recovery exercises.
We would stop a worker during a scan and verify that the job recovers correctly.
We would remove an API instance and check whether requests continue through healthy capacity.
We would test missing worker images, expired credentials, inaccessible artifact storage, and failed AI requests.
For cross-account recovery, we would verify that the standby environment can operate when the primary is unavailable—not merely when both environments are healthy.
We would also test failback.
Returning traffic to the primary environment must not create duplicate jobs, lose completed reports, or overwrite newer state.
These tests would give us evidence for the reliability claims we make.

Helping builders move from generated code to reviewed code

Vibe coding is making software development accessible to more people.
That is a valuable change. The next challenge is helping those builders understand what they have created and where it may fail.
TraceGuard is our attempt to make that process practical: run independent scanners, preserve their evidence, explain the results, and give developers a clear path toward remediation.
AWS provides a strong foundation for the next stage of that platform: isolated compute, durable job processing, controlled private networking, and a recovery architecture that can be tested.
Our aim is not to tell developers that an AI-generated application is secure because it runs.
It is to help them ask better questions, collect the evidence, and verify the changes before they ship.
Built an app with AI?    Scan your repository with TraceGuard  and understand its security risks.
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article