brave-provider-auth
Skill0 starsChanged 8 days agoMITView on GitHub
Use when authenticating AI providers across Brave profiles.
In this repository83 other files it gives its agents.
- AGENTS.mdAGENTS.md
- aes-docsSkill
- aes-fixSkill
- aes-layerSkill
- aes-migrationSkill
- aesSkill
- android-emulator-linux-gpsSkill
- computer-useSkill
- flatpak-chromium-automationSkill
- qwen-webSkill
- computer-useSkill
- grok-buildSkill
- hermes-agentSkill
- omnirouteSkill
- orcaSkill
- account-managerSkill
- brave-automationSkill
- brave-setupSkill
- brave-sync-managementSkill
- password-managerSkill
- codegraphSkill
- deep-cleanSkill
- dogfoodSkill
- reviewSkill
- systematic-debuggingSkill
- blender-arwakySkill
- comfyuiSkill
- llm-writingSkill
- vision-arwakySkill
- playwright-toolingSkill
- setup-ci-quality-gatesSkill
- statuslineSkill
- systemd-headless-serviceSkill
- xdg-spec-complianceSkill
- figcraft-builderSkill
- figcraft-iconsSkill
- figcraft-motionSkill
- figcraft-prototyperSkill
- figcraft-reviewSkill
- figcraftSkill
- figcraft-svgSkill
- figcraft-typographySkill
- github-workflowSkill
- issue-makerSkill
- issue-workerSkill
- mergifySkill
- pr-babysitSkill
- releasingSkill
- ascii-artSkill
- ascii-videoSkill
- gif-searchSkill
- media-acquisitionSkill
- docxSkill
- emailSkill
- google-workspaceSkill
- notionSkill
- pdfSkill
- pptxSkill
- xlsxSkill
- competitor-news-monitorSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 2 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 13
Explicit Display: Always launch Brave with DISPLAY=:1 (or current $DISPLAY).
- Distinctive: line 15
Handle Email Form Backtrack: If an email/password form appears on the provider page, detect the "Back to sign in options" button and click …
- Very specific: line 22
Playwright Event Loop Conflict: When mixing headless dashboard automation and CDP profile automation, reuse the existing sync_playwright() …
- Very specific: line 25
No Idle-Sleep Polling: Never sleep for long intervals (sleep 60/120/180) while polling or diagnosing stuck runs.
- Very specific: line 33
Handle
myaccount.google.comRedirect: If clicking an account in the chooser signs the user into Google but drops OAuth params, … - Distinctive: line 50
Dashboard Modal: Must keep the OmniRoute dashboard browser/modal OPEN during device authorization.
≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Brave Provider Auth Automation
Automation recipes and operational rules for connecting third-party AI providers to the local OmniRoute gateway (http://127.0.0.1:7777) across isolated Brave profiles (profile.csv).
Core Rules
- Explicit Display: Always launch Brave with
DISPLAY=:1(or current$DISPLAY). Background/daemon terminal processes default to emptyDISPLAYand fail to acquire X11/CDP locks. - Never Passkey: On modern AI provider login surfaces (like Kilo Code / app.kilo.ai), the UI defaults to passkey prompts ("Waiting for your passkey…"). Always target "Continue with Google" or "or see other sign-in methods". Never click generic "sign in" or "continue" buttons that trigger passkeys.
- Handle Email Form Backtrack: If an email/password form appears on the provider page, detect the "Back to sign in options" button and click it to recover the "Continue with Google" option.
- Session Cookie Injection: Load session cookies from
~/.local/share/baa/session/{profile}_cookies.jsoninto the Brave CDP context before navigating. This preserves Google authentication and avoids fresh-login security challenges. - Keep Dashboard Modal Open: For device-auth flows (like Kilo Code), keep the OmniRoute dashboard browser/modal open during authorization so its backend poller can receive the token and write to
storage.sqlite. - Multilingual Consent: Handle Google OAuth consent buttons in both English (
"Continue","Allow") and Indonesian ("Lanjutkan","Setuju"). Always compile matching regexes without anchors (^...$) because Google buttons often enclose newlines or inner spans (\nLanjutkan\n). - Human-in-the-Loop for Security Challenges:
- Google reCAPTCHA / "Confirm you're not a robot" and phone 2FA (
challenge/dp) cannot and must not be solved via blind click scripts. - Yield execution to the user with an interactive runner (
kc_interactive.py), announce the specific challenge clearly, and poll for DB updates.
- Google reCAPTCHA / "Confirm you're not a robot" and phone 2FA (
- Playwright Event Loop Conflict: When mixing headless dashboard automation and CDP profile automation, reuse the existing
sync_playwright()instance rather than calling.start()multiple times on the same thread. Ensureplaywright install chromiumhas run in the environment. - Inspect before scripting: Before writing click logic for a new provider, open the auth page in a visible Brave window and enumerate
get_by_role("link")andget_by_role("button")separately. OAuth "Continue with X" elements are often<a>links, not buttons — a button locator matches zero elements and the loop spins without action. Confirm the element role matches the locator role before automating. - Strict mode violations:
get_by_rolewith a name regex can match multiple elements (e.g. two "Connect" buttons in a dialog). Always use.first.click()to avoidstrict mode violationerrors that abort the entire run. - No Idle-Sleep Polling: Never sleep for long intervals (
sleep 60/120/180) while polling or diagnosing stuck runs. Inspect process state and logs actively, detect page DOM changes immediately, and enforce hard timeouts per stage. - CDP Port & Process Tree Cleanup: Terminating only the parent Brave process leaves zygote and renderer children holding the debugging port. Always issue
pkill -9 -f "remote-debugging-port={PORT}"and verify port release via HTTP probe (/json/version) before starting the next profile.
Google OAuth & Account Chooser Recipes
- Account Selection: On Google account chooser pages (
v3/signin/accountchooser), select the target account viapage.locator(f'[data-identifier="{email}"]').first.click(force=True). Generic text or[role=link]clicks fail because Google binds internal handlers todata-identifiercontainers. - Check Consent Screen Before Chooser Fallbacks: Always evaluate for the OAuth consent screen (
accounts.google.com/signin/oauth/idorv3/consent) BEFORE evaluating account chooser logic. On consent screensdata-identifieris absent; running chooser checks first causes the automation to falsely assume the account is missing and trigger fallback navigations that abort the OAuth flow. - Signed Out Chooser Fallback: If the account card displays "Signed out", do not navigate to
/signin/v2/identifier(Google redirects back to the chooser). Click "Use another account" / "Gunakan akun lain" to access the form, then fillinput[name="identifier"](type is text, not email) andinput[type="password"]using credentials fromprofile.csv. - Handle
myaccount.google.comRedirect: If clicking an account in the chooser signs the user into Google but drops OAuth params, redirecting tomyaccount.google.com, immediately re-navigate to the originalauth_url. The active session will auto-proceed through the OAuth flow.
Provider Patterns
Cline (api.cline.bot)
- Type: OAuth redirect + callback-paste flow.
- AuthKit page: Cline uses AuthKit (
authkit.cline.bot), NOT the same UI as Kilo Code. "Continue with Google" is a<a>link, not a<button>— usepage.get_by_role("link", name=re.compile(r"continue with google", re.IGNORECASE)). Clicking a button locator silently matches nothing and the script loops forever. - Dashboard flow: Dashboard Connect button → consent dialog ("I understand, continue") → dialog with auth URL input → extract URL → open in Brave → after Google login, redirect chain goes
authkit.cline.bot→accounts.google.com→api.cline.bot/api/v1/auth/callback→localhost:7777/callback?code=...&state=...→ capture the final callback URL → paste it back into the dashboard dialog's second input and click Connect. - Callback URL capture: Poll
page.urlforlocalhost:7777/callbackor (code=ANDlocalhost). Do not stop atapi.cline.bot— that is an intermediate redirect, not the final callback. - Google consent: Same multilingual consent patterns as other providers (Continue/Allow/Lanjutkan/Setuju/Izinkan).
- Challenge handling: Same as other providers — if Google shows reCAPTCHA/2FA/password, switch to interactive runner and wait for manual resolution.
- Success verification: Query
~/.omniroute/storage.sqliteforSELECT email FROM provider_connections WHERE provider='cline' AND is_active=1.
Provider Patterns
Kilo Code (app.kilo.ai)
- Type: Device auth flow (
/device-auth?code=XXXX-XXXX). - Dashboard Modal: Must keep the OmniRoute dashboard browser/modal OPEN during device authorization; closing it early breaks backend token polling.
- Session Cookie Injection: Load session cookies from
~/.local/share/baa/session/{profile}_cookies.jsoninto the Brave CDP context before navigating to avoid unexpected re-authentication. - Initial page: Defaults to passkey wait. Action: click
button[name*="Continue with Google"](if email form appears, click "Back to sign in options" first). - Google OAuth: Selects profile in account chooser. Fills password from
profile.csvif prompted. - Multilingual Consent: Clicks consent button supporting both English (
"Continue","Allow") and Indonesian ("Lanjutkan","Setuju"). - Challenge state: Google may prompt with
signin/challenge/recaptchaorsignin/challenge/dp(phone 2FA). Pause automation with interactive runner and notify user. - Success: Clicks "Authorize" on Kilo Code device page, then verifies registration in
~/.omniroute/storage.sqlite.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

