Inspiration

Enterprise projects usually have a defined start and finish, but the resources created for them often keep running long after the original work is over.

Dashboards continue refreshing, scheduled jobs keep executing, permissions remain active, service accounts retain access, reports keep generating, and datasets stay online even when the business reason for them has disappeared.

The real problem is not simply finding old resources. It is understanding why a resource exists, whether that reason still holds, and what could break if it is removed.

That inspired PurposeSweep.

PurposeSweep gives the reason a resource exists a lifecycle too.

What it does

PurposeSweep is an autonomous business-intent lifecycle cleanup agent.

It discovers enterprise resources, reconstructs their purpose from evidence, maps dependencies, proposes cleanup actions, applies deterministic safety policy, pauses for human approval when necessary, executes only authorized changes, independently verifies the result, and produces an auditable closure report.

Gemini 3.6 Flash helps interpret evidence and reconstruct business intent, while Google ADK supports the agentic orchestration.

The important safety boundary is that AI can reason and recommend, but it cannot authorize or directly execute infrastructure mutations.

Every proposed action receives one of three deterministic policy outcomes:

  • AUTO — safe for automatic execution
  • APPROVAL_REQUIRED — requires explicit human authorization
  • BLOCKED — cannot execute

A human cannot override a blocked policy decision.

In the canonical demo, Project Atlas has finished, while Project Mercury is still active. Atlas originally created customer_revenue_core, but Mercury still depends on it.

PurposeSweep considers deleting the dataset, detects the active dependency, and returns:

DELETE → BLOCKED

The cleanup continues safely around that dependency, leaving Mercury healthy with zero broken dependencies.

How we built it

PurposeSweep is built as a layered system so reasoning, policy, execution, and verification remain separate.

The frontend is built with Next.js and TypeScript, while the backend uses FastAPI and Python.

Gemini 3.6 Flash is used for evidence interpretation and purpose reconstruction. Google Agent Development Kit provides the agentic orchestration layer.

The core workflow is:

Discover → Reconstruct Purpose → Map Dependencies → Plan Cleanup → Apply Safety Policy → Human Approval → Execute → Verify → Close

The deterministic policy engine sits between AI reasoning and execution. Gemini may recommend an action, but only policy can authorize it.

Authorized actions execute through constrained connectors, and PurposeSweep independently re-reads system state afterward instead of trusting the executor's success response.

The deployed application runs on Google Cloud Run with Firestore-backed persistence. Cloud Build and Artifact Registry support the deployment workflow.

Challenges we ran into

One of the biggest challenges was designing autonomy without giving the AI unsafe authority.

It would have been easy to let a high-confidence model output directly trigger cleanup. Instead, PurposeSweep treats model reasoning as advisory and keeps authorization deterministic.

Another challenge was dependency safety. A resource can belong historically to a finished project while still being critical to an active one. This is why PurposeSweep models resource origin separately from current consumption.

Independent verification was also important. An executor saying “success” is not enough. PurposeSweep verifies the actual resulting state before counting an action as completed.

We also had to solve practical deployment issues while connecting the Next.js frontend and FastAPI backend across Cloud Run, including build-time API configuration and CORS between deployed services.

Accomplishments that we're proud of

We are especially proud that PurposeSweep does not simply optimize for more automation. It is designed to automate safely.

The canonical demo deliberately proposes an unsafe deletion of a shared dataset and proves that the policy layer blocks it even when the original project is already finished.

The final demo result shows:

  • 6 resources cleaned up
  • 8 resources preserved
  • 1 shared resource protected
  • 1 unsafe deletion blocked
  • 0 broken dependencies
  • Project Mercury healthy
  • $263/month in verified waste eliminated

We are also proud of the separation between AI reasoning and authorization. Gemini can interpret evidence and recommend actions, while deterministic policy remains the final authority.

PurposeSweep was also deployed end-to-end on Google Cloud, with a live web application, API, Firestore persistence, Gemini 3.6 Flash integration, and Google ADK integration.

What we learned

The biggest lesson was that autonomy and authority should not be treated as the same thing.

AI models are very useful for interpreting ambiguous evidence and reconstructing business context, but deterministic controls are better suited for irreversible safety decisions.

We also learned that enterprise cleanup is fundamentally a dependency problem, not simply an age or inactivity problem.

A resource being old, inactive, or associated with a completed project does not automatically make it safe to remove.

PurposeSweep therefore combines AI reasoning, dependency analysis, deterministic policy, human approval, execution, and independent verification into one lifecycle.

What's next for PurposeSweep

The next step is connecting PurposeSweep to real enterprise systems instead of only simulated demo resources.

Future integrations could include:

  • Google Cloud resources
  • identity and access systems
  • collaboration platforms
  • scheduling systems
  • data warehouses and analytics platforms
  • monitoring and observability systems
  • CI/CD systems
  • SaaS administration platforms

The longer-term goal is for PurposeSweep to continuously detect resources whose business purpose has expired, understand what still depends on them, and safely close them without breaking active work.

PurposeSweep could eventually become a lifecycle intelligence layer across enterprise systems, helping organizations reduce operational waste, stale access, unnecessary infrastructure, and hidden dependency risk.

Built With

Share this project:

Updates

Submission history