Orca Engineering Deep-Dive

How Orca Solves Google Login & Cookie Partitioning

An interactive visual guide exploring how Orca's built-in agent browser overcomes Google's anti-bot blocks, manages multi-tenant session partitions, and maintains high-fidelity CHIPS cookie state.

🚨 The 3 Traps in Custom & Embedded Browsers

Google employs some of the web's most sophisticated fraud prevention and session binding mechanisms. When running inside an embedded agent browser shell, three distinct hurdles arise:

🛑 1. "Browser Not Secure" Block

Google inspects User-Agent tokens, Client Hints (Sec-CH-UA), and automation variables. If it detects Electron or an automated agent browser, sign-in is immediately denied.

"Couldn't sign you in. This browser or app may not be secure."
⛓️ 2. The Cookie Transplant Trap

Google cookies (SID, SAPISID, __Secure-1PSID) are cryptographically bound to the physical browser instance.

Transplanted cookies trigger anti-fraud and expire in ~1 hour.
💥 3. Partition Loss & Collision

Standard Electron APIs (cookies.set) silently discard CHIPS partition keys (topLevelSite), breaking third-party iframe logins and SSO.

Partition metadata stripped → Embedded OAuth & session state broken.

🎯 How Orca Solves This: The 4-Pillar Design

Click any pillar below to jump directly into its interactive deep-dive demonstration:

🎭 1. Targeted Auth Camouflage

When Orca navigates to accounts.google.com, it dynamically swaps the UA to authentic Firefox, strips Client Hints, and neutralizes bot signals. The user signs in natively inside Orca's browser, producing permanent, self-refreshing credentials.

🧱 2. Isolated Session Partitions

Each workspace / profile in Orca is strictly segregated via Electron partitions (persist:orca-browser-session-...). Work and personal accounts never collide or bleed state across worktrees.

🔬 3. Lossless CHIPS CDP Injection

Orca bypasses Electron's lossy cookies.set by leasing a Chrome DevTools Protocol (CDP) debugger to write partitioned cookies directly with full topLevelSite fidelity.

🛡️ 4. Google Domain Protection Shield

During cookie imports, Google domains (NON_TRANSPLANTABLE_DOMAINS) are exempted from overwriting or clearing, preserving live native sessions forever.

🎮 Interactive Scenario Simulator: Sign-In Flow

Test what Google and web servers see during navigation with and without Orca's adaptive auth handler.

🔒 https://accounts.google.com/signin
Outgoing Request Headers & Signals in Orca accounts.google.com
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:140.0) Gecko/20100101 Firefox/140.0
Sec-CH-UA (Client Hints): Stripped (None sent)
navigator.webdriver: false (Masked by Orca Anti-Detection)
window.chrome: undefined (Matches Firefox profile)
Session Partition: persist:orca-browser-session-work

🍪 Cookie Partitioning (CHIPS) & CDP Debugger Injection in Orca

Modern web security isolates third-party cookies by their top-level site context. Here is why default Electron fails and how Orca's agent browser solves it with Chrome DevTools Protocol (CDP).

Default Electron: session.cookies.set()

Electron's high-level cookies API silently ignores partitionKey.

// Electron silently strips partitionKey!
await session.cookies.set({
  name: 'chips-auth',
  partitionKey: { topLevelSite: '...' } // ⚠️ IGNORED
})

Result: Embedded Google login iframes or third-party OAuth widgets cannot find their partitioned cookies and fail.

Orca's Solution: CDP Network.setCookie

Orca acquires a leased CDP debugger connection to talk directly to Chromium's internal Network domain.

// 100% Partition Fidelity via CDP
await debugger.sendCommand('Network.setCookie', {
  name: 'chips-auth',
  partitionKey: {
    topLevelSite: 'https://app.com',
    hasCrossSiteAncestor: true
  }
})

Result: Full support for CHIPS cookies, cross-site ancestor keys, and resilient embedded logins.

Structure of a Partitioned Cookie (CHIPS)

🛡️ Safe Cookie Import: Orca's Google Exclusion Policy

When a user imports cookies from Chrome, Brave, or Firefox into Orca, what happens to their Google session?

⚙️ Orca Cookie Import Pipeline Simulator
📂 Source (External Chrome)
github: session Import
google: SID Bound
linear: token Import
accounts.google: PSID Bound
🛡️
Orca Policy Filter
NON_TRANSPLANTABLE_DOMAINS
🎯 Orca Partition Jar (persist:...)
Click 'Simulate Browser Cookie Import' to run
🔒

Atomic Snapshot & Rollback Guarantee

Before modifying any cookie coordinate in Orca, the store takes an exact CDP snapshot of the target session. If any network command fails halfway, restoreClearIdentities() rolls back the entire coordinate losslessly in reverse order.

🏗️ Orca Architecture Blueprint

How Orca orchestrates the Electron main process, CDP debugger lease, dynamic user agent router, anti-detection shields, and partitioned cookie stores.

Orca Browser Tab Worktree Request Orca Auth Classifier accounts.google.com? YES → Firefox UA + Strip Hints NO → Profile Chromium UA Google Accounts Server Native In-Browser Authentication Mints Permanent Device-Bound Tokens Workspace Partition (persist:...) CDP Debugger Lease (Network.setCookie) CHIPS Cookie Jar (topLevelSite) Preserves Cross-Site Ancestor State Orca Import Safety Guard Exempts Google Cookies from Overwrite Atomic Snapshot & Rollback Ledger Zero Live Session Corruption
1

Strict Local Execution

Everything runs inside the local partition instance. No credentials or tokens leave the developer's machine.

2

Anti-Detection Shielding

Page.addScriptToEvaluateOnNewDocument overrides CDP debugger flags, plugin arrays, and automation markers to mirror genuine user browsers.

🐙 Explore Orca on GitHub ★ 53k

Want to see more details on how Orca powers parallel AI coding agents, worktree isolation, and agent browser automation? Check out our open-source repo!

⭐ View stablyai/orca on GitHub