grip — Complete Design

A Python SDK for AI agents to interact with the web. Token-efficient, secure, built on CDP. Review each section and confirm in the terminal.

What it is
grip
A Python SDK that gives AI agents a precise, token-efficient, secure way to read and interact with any website.
pip install grip-browser
Core API — what a developer writes
Simple — let grip handle everything
from grip import Browser

browser = Browser(llm=my_llm)

result = await browser.run(
  "Find cheapest blue sneakers",
  url="amazon.com"
)

print(result.data) # structured
print(result.trace) # full trace
print(result.tokens) # always tracked
Precise — full control for your agent loop
page = await browser.open("amazon.com")

# compact — not raw HTML
state = await page.snapshot()

# semantic — not CSS selectors
await page.click("search bar")
await page.type("blue sneakers")

data = await page.extract({
  "results": "list[Product]"
})
Structured Errors — what the agent receives when something breaks
# Instead of: "Error: element not found"
# grip returns:

BrowserError(
  type=ErrorType.ELEMENT_STALE,
  message="Button ref stale after React re-render",
  confidence=0.94,
  recovery=[
    RecoveryAction.RE_SNAPSHOT, # take fresh snapshot
    RecoveryAction.RETRY # retry the action
  ]
)
What ships in V1 vs later
V1 — Ships first
✓ CDP engine (Chrome/Chromium launch + connect)
✓ Compression layer (semantic summaries, element cache, snapshot versioning)
✓ Security sanitizer (injection guard, hidden filter)
✓ Typed error recovery (6 error types)
✓ Full Shadow DOM access
✓ Primitive API: snapshot, click, type, extract, observe
✓ High-level: run(goal, llm)
✓ Observability trace (token counts, action log)
✓ LLM-agnostic (works with any model)
V2 — After validation
→ Vision fallback for canvas apps (Figma, Sheets)
→ Cloud browser support (Browserbase, Steel)
→ Advanced bot detection evasion
→ TypeScript SDK
→ WebMCP support (when Chrome ships it broadly)
→ Benchmark suite (realistic network faults)
Does this look right? If yes, I'll write the full spec document and we move to implementation planning.