Skip to content

Commit 5c9e36d

Browse files
jarvisjarvis
authored andcommitted
feat: full product with x402 checkout, analytics, SEO
1 parent dd98349 commit 5c9e36d

16 files changed

Lines changed: 8334 additions & 1415 deletions

File tree

.github/workflows/pages.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Deploy to GitHub Pages
2+
on:
3+
push:
4+
branches: [main]
5+
permissions:
6+
contents: read
7+
pages: write
8+
id-token: write
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
- uses: pnpm/action-setup@v4
15+
with:
16+
version: 9
17+
- uses: actions/setup-node@v4
18+
with:
19+
node-version: 22
20+
cache: pnpm
21+
- run: pnpm install --frozen-lockfile
22+
- run: |
23+
mv app/api app/_api 2>/dev/null || true
24+
echo "module.exports = { output: 'export', images: { unoptimized: true } }" > next.config.js
25+
pnpm build
26+
- uses: actions/upload-pages-artifact@v3
27+
with:
28+
path: out
29+
deploy:
30+
needs: build
31+
runs-on: ubuntu-latest
32+
environment:
33+
name: github-pages
34+
url: ${{ steps.deployment.outputs.page_url }}
35+
steps:
36+
- id: deployment
37+
uses: actions/deploy-pages@v4

CLAUDE.md

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,40 @@
1-
@AGENTS.md
1+
# AgentAudit -- AI Agent Security Scanner
2+
3+
## Project Overview
4+
AgentAudit is a security scanner for AI agent configurations (CLAUDE.md, .cursorrules, MCP configs). It analyzes configs client-side for vulnerabilities and provides a risk score with actionable fixes.
5+
6+
## Tech Stack
7+
- Next.js 16 (App Router, TypeScript, Tailwind CSS v4)
8+
- framer-motion for animations
9+
- x402-next + @coinbase/x402 for crypto payments (USDC on Base)
10+
- JetBrains Mono font, dark theme
11+
12+
## Architecture
13+
- `lib/scanner.ts` — Core scanner logic: pattern matching, absence checks, scoring (A-F grades)
14+
- `app/page.tsx` — Landing page with scanner UI, results display, X402 payment gate
15+
- `app/api/full-report/route.ts` — x402-protected endpoint ($47 USDC) for full report
16+
- `app/success/page.tsx` — Payment confirmation page
17+
- `components/x402/` — Shared payment components (X402Checkout, PaymentSuccess)
18+
19+
## Business Logic
20+
- Free tier: risk score (A-F) + top 3 issues with fixes
21+
- Paid tier ($47): all issues + remediation steps + best practices checklist
22+
- All scanning runs client-side — no config data is sent to any server
23+
- Payment via x402 protocol to wallet `0xCc97e4579eeE0281947F15B027f8Cad022933d7e`
24+
25+
## Security Categories Checked
26+
1. Shell Access Permissions (rm -rf, sudo, chmod 777, eval, pipe-to-shell)
27+
2. File System Scope (root access, home dir, sensitive paths)
28+
3. MCP Server Trust (exec servers, filesystem, browser automation)
29+
4. Secret Exposure (API keys, AWS creds, private keys, passwords)
30+
5. Rate Limiting (usage caps, cost guards)
31+
6. Network Access (unrestricted fetch, tunnels)
32+
7. Tool Restrictions (deny rules, safety guardrails)
33+
8. Audit Logging (monitoring, action tracking)
34+
35+
## Key Commands
36+
```bash
37+
pnpm dev # Start dev server
38+
pnpm build # Production build
39+
pnpm lint # Run ESLint
40+
```

app/api/full-report/route.ts

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
import { NextRequest, NextResponse } from 'next/server'
2+
import { withX402 } from 'x402-next'
3+
4+
const handler = async (request: NextRequest) => {
5+
const body = await request.json()
6+
const { issues = [], grade = 'F', score = 0 } = body
7+
8+
// Generate remediation steps based on issues
9+
const remediationSteps = issues.map((issue: { severity: string; title: string; fix: string }, index: number) => ({
10+
priority: index + 1,
11+
severity: issue.severity,
12+
action: issue.title,
13+
steps: [issue.fix],
14+
}))
15+
16+
// Best practices checklist
17+
const bestPractices = [
18+
{ check: 'Scope file access to project directory only', category: 'Principle of Least Privilege' },
19+
{ check: 'Remove sudo/root access from agent', category: 'Principle of Least Privilege' },
20+
{ check: 'Add explicit deny rules for destructive commands', category: 'Defense in Depth' },
21+
{ check: 'Include safety guardrails in agent instructions', category: 'Defense in Depth' },
22+
{ check: 'Remove hardcoded secrets, use environment variables', category: 'Secret Management' },
23+
{ check: 'Audit all MCP servers for trust level', category: 'MCP Security' },
24+
{ check: 'Restrict network access to required domains only', category: 'Network Security' },
25+
{ check: 'Add rate limits and cost caps', category: 'Cost Control' },
26+
{ check: 'Enable audit logging for all agent actions', category: 'Monitoring' },
27+
{ check: 'Review and update config quarterly', category: 'Maintenance' },
28+
]
29+
30+
return NextResponse.json({
31+
success: true,
32+
report: {
33+
grade,
34+
score,
35+
totalIssues: issues.length,
36+
issues,
37+
remediationSteps,
38+
bestPractices,
39+
generatedAt: new Date().toISOString(),
40+
},
41+
})
42+
}
43+
44+
export const POST = withX402(
45+
handler,
46+
'0xCc97e4579eeE0281947F15B027f8Cad022933d7e',
47+
{
48+
price: '$47',
49+
network: 'base',
50+
config: {
51+
description: 'AgentAudit -- Full Security Report',
52+
},
53+
}
54+
)

app/globals.css

Lines changed: 84 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,98 @@
11
@import "tailwindcss";
22

33
:root {
4-
--background: #ffffff;
5-
--foreground: #171717;
4+
--background: #06080d;
5+
--foreground: #e2e8f0;
6+
--accent: #f43f5e;
7+
--accent-soft: #f43f5e22;
8+
--card: #0d1117;
9+
--card-border: #1e293b;
10+
--muted: #64748b;
611
}
712

813
@theme inline {
914
--color-background: var(--background);
1015
--color-foreground: var(--foreground);
11-
--font-sans: var(--font-geist-sans);
12-
--font-mono: var(--font-geist-mono);
13-
}
14-
15-
@media (prefers-color-scheme: dark) {
16-
:root {
17-
--background: #0a0a0a;
18-
--foreground: #ededed;
19-
}
16+
--color-accent: var(--accent);
17+
--color-accent-soft: var(--accent-soft);
18+
--color-card: var(--card);
19+
--color-card-border: var(--card-border);
20+
--color-muted: var(--muted);
21+
--font-sans: var(--font-jetbrains);
22+
--font-mono: var(--font-jetbrains);
2023
}
2124

2225
body {
2326
background: var(--background);
2427
color: var(--foreground);
25-
font-family: Arial, Helvetica, sans-serif;
28+
}
29+
30+
/* Scanline animation for the hero */
31+
@keyframes scanline {
32+
0% { transform: translateY(-100%); }
33+
100% { transform: translateY(100vh); }
34+
}
35+
36+
.scanline {
37+
animation: scanline 3s linear infinite;
38+
}
39+
40+
/* Pulse glow for scan button */
41+
@keyframes pulse-glow {
42+
0%, 100% { box-shadow: 0 0 20px rgba(244, 63, 94, 0.3); }
43+
50% { box-shadow: 0 0 40px rgba(244, 63, 94, 0.6); }
44+
}
45+
46+
.pulse-glow {
47+
animation: pulse-glow 2s ease-in-out infinite;
48+
}
49+
50+
/* Grade colors */
51+
.grade-A { color: #10b981; background: #10b98120; border-color: #10b98140; }
52+
.grade-B { color: #22d3ee; background: #22d3ee20; border-color: #22d3ee40; }
53+
.grade-C { color: #f59e0b; background: #f59e0b20; border-color: #f59e0b40; }
54+
.grade-D { color: #f97316; background: #f9731620; border-color: #f9731640; }
55+
.grade-F { color: #ef4444; background: #ef444420; border-color: #ef444440; }
56+
57+
/* Severity badges */
58+
.severity-critical { color: #ef4444; background: #ef444415; border: 1px solid #ef444430; }
59+
.severity-high { color: #f97316; background: #f9731615; border: 1px solid #f9731630; }
60+
.severity-medium { color: #f59e0b; background: #f59e0b15; border: 1px solid #f59e0b30; }
61+
.severity-low { color: #22d3ee; background: #22d3ee15; border: 1px solid #22d3ee30; }
62+
63+
/* Blur overlay for locked content */
64+
.blur-locked {
65+
filter: blur(6px);
66+
user-select: none;
67+
pointer-events: none;
68+
}
69+
70+
/* Terminal cursor blink */
71+
@keyframes blink {
72+
0%, 50% { opacity: 1; }
73+
51%, 100% { opacity: 0; }
74+
}
75+
76+
.cursor-blink {
77+
animation: blink 1s step-end infinite;
78+
}
79+
80+
/* Smooth scroll */
81+
html {
82+
scroll-behavior: smooth;
83+
}
84+
85+
/* Custom scrollbar */
86+
::-webkit-scrollbar {
87+
width: 6px;
88+
}
89+
::-webkit-scrollbar-track {
90+
background: var(--background);
91+
}
92+
::-webkit-scrollbar-thumb {
93+
background: var(--card-border);
94+
border-radius: 3px;
95+
}
96+
::-webkit-scrollbar-thumb:hover {
97+
background: var(--muted);
2698
}

app/layout.tsx

Lines changed: 69 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,79 @@
1-
import type { Metadata } from "next";
2-
import { Geist, Geist_Mono } from "next/font/google";
3-
import "./globals.css";
1+
import type { Metadata } from "next"
2+
import { JetBrains_Mono } from "next/font/google"
3+
import { Analytics } from "@/components/Analytics"
4+
import "./globals.css"
45

5-
const geistSans = Geist({
6-
variable: "--font-geist-sans",
6+
const jetbrains = JetBrains_Mono({
7+
variable: "--font-jetbrains",
78
subsets: ["latin"],
8-
});
9-
10-
const geistMono = Geist_Mono({
11-
variable: "--font-geist-mono",
12-
subsets: ["latin"],
13-
});
9+
display: "swap",
10+
})
1411

1512
export const metadata: Metadata = {
16-
title: "Create Next App",
17-
description: "Generated by create next app",
18-
};
13+
title: "AgentAudit -- AI Agent Security Scanner",
14+
description:
15+
"Paste your CLAUDE.md, .cursorrules, or MCP config. Get a security risk score + actionable fixes. Free scan, $47 full report.",
16+
keywords: [
17+
"AI agent security",
18+
"CLAUDE.md scanner",
19+
"cursorrules audit",
20+
"MCP config security",
21+
"AI coding agent security",
22+
"agent configuration audit",
23+
],
24+
openGraph: {
25+
title: "AgentAudit -- AI Agent Security Scanner",
26+
description:
27+
"Your AI agent has more access than your junior dev. Have you audited it?",
28+
type: "website",
29+
siteName: "AgentAudit",
30+
},
31+
twitter: {
32+
card: "summary_large_image",
33+
title: "AgentAudit -- AI Agent Security Scanner",
34+
description:
35+
"Scan CLAUDE.md, .cursorrules, MCP configs for security vulnerabilities in 10 seconds.",
36+
},
37+
robots: {
38+
index: true,
39+
follow: true,
40+
},
41+
}
1942

2043
export default function RootLayout({
2144
children,
22-
}: Readonly<{
23-
children: React.ReactNode;
24-
}>) {
45+
}: {
46+
children: React.ReactNode
47+
}) {
2548
return (
26-
<html
27-
lang="en"
28-
className={`${geistSans.variable} ${geistMono.variable} h-full antialiased`}
29-
>
30-
<body className="min-h-full flex flex-col">{children}</body>
49+
<html lang="en" className={`${jetbrains.variable} h-full antialiased dark`}>
50+
<head>
51+
<script
52+
type="application/ld+json"
53+
dangerouslySetInnerHTML={{
54+
__html: JSON.stringify({
55+
"@context": "https://schema.org",
56+
"@type": "SoftwareApplication",
57+
name: "AgentAudit",
58+
description:
59+
"AI agent security scanner. Paste your CLAUDE.md, .cursorrules, or MCP config. Get a security risk score and actionable fixes.",
60+
url: "https://agentaudit.dev",
61+
applicationCategory: "SecurityApplication",
62+
operatingSystem: "Web",
63+
offers: {
64+
"@type": "Offer",
65+
price: "47",
66+
priceCurrency: "USD",
67+
availability: "https://schema.org/InStock",
68+
},
69+
}),
70+
}}
71+
/>
72+
</head>
73+
<body className="min-h-full flex flex-col bg-background text-foreground font-mono">
74+
<Analytics product="agentaudit" />
75+
{children}
76+
</body>
3177
</html>
32-
);
78+
)
3379
}

0 commit comments

Comments
 (0)