SAP Browser Automation
Use this skill as the shared browser layer for SAP-specific skills. It owns surface selection,
authentication bootstrap, isolated Edge/CDP startup, state reuse, target verification, evidence,
recovery, and cleanup. The consuming skill still owns the SAP action boundaries: story edits,
planning writeback, model changes, Datasphere deployment, SQL execution, and test acceptance.
Related Skills
- sap-sac-scripting: SAC story/runtime scripting and reporting-story implementation.
- sap-sac-test-automation: SAC acceptance, discovery packets, Playwright suites, and evidence.
- sap-sac-planning: SAC planning models, writeback, versions, data actions, and locks.
- sap-datasphere: Datasphere modeling, deployment, spaces, connections, and administration.
- browser:control-in-app-browser: Installed in-app Browser runtime and secure manual authentication.
When to Use This Skill
Use this skill whenever an agent must interact with an authenticated SAP web UI, select or inspect a
browser target, start Edge with loopback CDP, reuse an approved Edge profile, transfer scoped browser
state to an already-installed compatible client, or recover from browser bootstrap/authentication
failure. Do not use it for code-only, API-only, CLI-only, or database-native tasks that do not need
visible browser state.
Quick Reference
| Need |
Route |
| Manual SSO in the current browser |
In-app Browser, then visible signed-in verification |
| Enterprise Edge or no Playwright installation |
Fresh isolated Edge with copied profile and loopback CDP |
| Independent compatible browser context |
Existing Playwright plus scoped storageState or CDP state transfer |
| Missing auth or failed browser bootstrap |
User-assisted login, recovery, or specification-only handoff |
Requested browser and connection are binding
If the user names Chrome, Edge, Chrome DevTools MCP, CDP, or a local DevTools bridge, use only that
browser and connection method. Do not silently switch to the In-app Browser, a ChatGPT browser
extension, Playwright, Computer Use, another browser, or shell automation. If the requested surface is
not available, report the exact blocker and stop at that boundary.
Operating contract
- Prefer a connector, API, CLI, or database-native check when it can answer the request without a browser.
- Use the in-app Browser first only when the user has not named a different browser or connection method.
- Ask the user to authenticate manually in the in-app Browser when its target redirects to SSO. Use its secure authentication capability; never ask for passwords or OTPs in chat.
- After in-app verification, use the fresh Edge path for reliable automation when the task needs CDP, enterprise extensions, or a reusable profile.
- Treat MCP configuration and MCP availability as separate checks. After configuration, verify that the server tools are present in the active tool registry. A successful
codex mcp get check alone does not make the MCP usable.
- Require a live handshake, such as
list_pages, and verify that the returned pages belong to the requested browser. If the tools are missing after configuration, ask the user to restart Codex or open a new task before continuing.
- Ask explicit permission before reusing the user's authenticated normal Edge profile or closing Edge.
- Copy only after Edge is closed, and copy to an isolated profile path. Treat the copy, cookies, tokens, local storage, and storage-state files as credentials.
- Bind CDP to
127.0.0.1; never expose the port, WebSocket endpoint, profile, or auth state to a network, repository, log, screenshot, or Oracle review.
- Verify the tenant, host, path, title, authenticated DOM, and target page before interaction. Never guess the first tab or target ID.
- Default to read-only actions. The consuming SAP skill must explicitly authorize writes, publishing, deployment, planning, model, permission, or destructive actions.
- Browser startup, CDP attachment, or a successful login redirect is not evidence that the requested SAP task completed.
Load the focused references only when needed:
references/edge-cdp-control.md for Edge launch, CDP discovery, target selection, and recovery.
references/auth-state-bootstrap.md for copying an authenticated Edge profile, exporting scoped state when available, and injecting it into compatible clients.
references/in-app-browser-auth.md for manual in-app authentication and capability boundaries.
- Run
scripts/edge-profile.ps1 for deterministic profile cloning, launch, status, and stop operations.
- Run
scripts/cdp-agent.mjs for target discovery, inspection, interaction, screenshots, and authentication-state transfer. It requires Node.js 22 or newer and no npm packages.
Standard workflow
1. Classify the task and choose a surface
Record the target application, tenant/host, requested URL, read/write intent, evidence required, and
whether the user approved profile reuse. Use this order:
- Existing non-browser tool if sufficient.
- The explicitly requested browser and connection method, after active-tool and live-handshake checks.
- In-app Browser for visible authenticated UI and manual SSO when no other browser or connection was requested.
- Fresh isolated Edge with loopback CDP for enterprise browser behavior and reusable authentication.
- Already-installed Playwright connected over CDP or using local storage state.
- Approved desktop/manual assistance or a specification-only handoff.
Do not install Playwright, browser binaries, MCP servers, or extensions in an enterprise environment
unless the user explicitly requests and approves that change. If Playwright is unavailable, Edge/CDP
remains the primary automation surface.
2. Authenticate in the in-app Browser
When no other browser or connection was requested, open the target using the installed Browser skill.
Inspect visible state. If the page requires SSO, pause for the user to complete the login manually
through the supported secure auth flow. Verify a positive signed-in signal on the target domain and
retain a screenshot or equivalent evidence when allowed.
Do not extract cookies, local storage, session storage, profile databases, passwords, or tokens from the
in-app Browser. Its session is independent from Edge. If it cannot expose an authenticated page after
manual login, record the failure and continue to the approved Edge path.
This route runs inside Codex or Claude Desktop. Its runtime validation is deferred to those desktop
environments and is not part of the standalone Edge/CDP acceptance tests.
3. Capture live Edge state, then bootstrap fresh Edge
Before touching the user's normal Edge profile, state the intended scope and ask for confirmation:
I will capture the approved SAP session from the currently authenticated Edge target, close normal Edge, and clone its selected profile into an isolated automation directory. May I continue?
If the user declines, ask them to authenticate once in the isolated profile. If they approve:
- Identify the normal Edge user-data root, selected
Default or Profile N, target URL, tenant host,
target path/title, approved SAP origin, and local temporary state-file path.
- While normal Edge is still running and visibly authenticated, open
edge://inspect/#remote-debugging and enable Allow remote debugging for this browser instance.
- Run
scripts/cdp-agent.mjs export-auth against the normal user-data directory. Require host, path,
and/or title filters that resolve exactly one approved page. Repeat --origin for approved SAP or
identity-provider cookie scopes.
- Close normal Edge and verify no
msedge.exe process still owns the source profile.
- Run
scripts/edge-profile.ps1 -Action CloneLaunch with the selected profile name and a new or empty
automation root. The helper preserves Profile N, refuses non-empty clone destinations, launches
with --remote-debugging-port=0, and verifies the listener discovered through DevToolsActivePort.
- Run
scripts/cdp-agent.mjs inspect and verify tenant, path, title, visible signed-in state, and page readiness.
- If cloning lost volatile state, run
scripts/cdp-agent.mjs import-auth against the isolated target,
reload, and repeat the authenticated-state inspection.
- If authentication still fails, ask the user to log in once in the isolated profile. Reuse it later
with
scripts/edge-profile.ps1 -Action LaunchExisting; never clone over a populated automation root.
The complete Windows commands, path checks, CDP probes, and recovery matrix are in
references/edge-cdp-control.md and references/auth-state-bootstrap.md.
4. Operate the verified target
Use the isolated Edge instance directly. Run scripts/cdp-agent.mjs --help for the complete command
surface. The bundled driver supports deterministic targets, inspection/snapshot, navigation,
evaluation, selector or coordinate clicks, text entry, key presses, screenshots, and auth-state
export/import without Playwright. Use an existing Playwright installation only when the consuming task
needs it; do not install it for this workflow.
Authentication transfer uses CDP Storage.getCookies and Storage.setCookies plus page-scoped
localStorage and sessionStorage. Recheck SSO redirects, SameSite behavior, certificates, and visible
readiness after import. The in-app Browser remains a separate session.
5. Verify readiness and perform the domain action
Before changing anything, verify:
- tenant and application identity;
- authenticated state, not merely a non-login URL;
- correct Story Designer, Modeler, Data Builder, SQL editor, or test target area;
- visible readiness markers and absence of blocking errors;
- approved host/path and selected target page;
- current model/story/widget metadata when the consuming skill requires it.
Capture page-specific evidence and explicit no-data/error states. Do not treat a spinner disappearing,
CDP connecting, or a browser window opening as task completion.
6. Recover or hand off honestly
Use the following fallback sequence:
- Retry the selected browser using its documented troubleshooting guidance.
- Use the Edge/CDP recovery and
DevToolsActivePort fallback.
- Ask for one-time manual authentication in the isolated Edge profile.
- Use approved desktop/manual assistance if the environment supports it.
- If no authenticated target can be verified, stop and provide an implementation-ready specification, the exact missing evidence, and the next manual action.
When the user explicitly named a browser or connection method, do not use this sequence to switch to a
different surface. Stop when the requested surface is unavailable or its live handshake fails.
Report authentication as verified, missing, expired, blocked, or unknown; never infer success
from browser bootstrap alone.
Troubleshooting
Common failures are handled in the shared Edge reference: refused or missing CDP endpoints, 404
discovery responses, wrong targets, SSO redirects, copied profiles that are not authenticated, policy
blocks, and runtime/widget errors. When recovery cannot establish a verified authenticated target,
stop and hand off the missing evidence rather than guessing or claiming completion.
Sources and Verification
The public-source review and the distinction between documented behavior and unverified tenant behavior
are recorded in docs/project/sap-browser-automation-source-review-2026-07-14.md.
Safety and evidence
Profile copies and auth-state files may contain cookies, refresh tokens, saved passwords, history,
extensions, and enterprise session data. Keep them in a user-local path with restricted access. Do not
place them under the repository, commit them, send them to Oracle, include them in bug reports, or
paste their contents into chat. Redact tenant IDs, story IDs, query strings, session-like URL values,
cookie values, WebSocket endpoints, and unrelated tabs from evidence.
For any write-capable action, record the approving user, target, intended mutation, before/after
verification, and rollback or cleanup status. The consuming SAP skill remains authoritative for
whether the action itself is allowed.
1---
2name: sap-browser-automation
3description: Use when an agent must inspect or operate an authenticated SAP web UI through an in-app Browser, Microsoft Edge CDP, or an existing Playwright client, especially when SAP SSO reuse, isolated Edge profiles, deterministic target selection, screenshots, or browser bootstrap recovery is required.
4license: GPL-3.0
5metadata:
6 source: https://skillmd.com/skills/secondsky/sap-browser-automation
7 maintainer: "Eduard Jiglau"
8 maintainer_email: "hello@sap-ai-skills.com"
9 website: "https://sap-ai-skills.com"
10 version: "2.4.1"
11 last_verified: 2026-07-14
12 documentation_source: "docs/project/sap-browser-automation-source-review-2026-07-14.md"
13 status: docs_audited_runtime_pending
14 known_issues:
15 - In-app Browser authentication is desktop-runtime-dependent and its validation is deferred to Codex or Claude Desktop.
16 - SAC and Datasphere SSO, cross-domain cookies, client certificates, MFA, and enterprise Edge policy require tenant-specific verification.
17---
18
19# SAP Browser Automation
20
21Use this skill as the shared browser layer for SAP-specific skills. It owns surface selection,
22authentication bootstrap, isolated Edge/CDP startup, state reuse, target verification, evidence,
23recovery, and cleanup. The consuming skill still owns the SAP action boundaries: story edits,
24planning writeback, model changes, Datasphere deployment, SQL execution, and test acceptance.
25
26## Related Skills
27
28- **sap-sac-scripting**: SAC story/runtime scripting and reporting-story implementation.
29- **sap-sac-test-automation**: SAC acceptance, discovery packets, Playwright suites, and evidence.
30- **sap-sac-planning**: SAC planning models, writeback, versions, data actions, and locks.
31- **sap-datasphere**: Datasphere modeling, deployment, spaces, connections, and administration.
32- **browser:control-in-app-browser**: Installed in-app Browser runtime and secure manual authentication.
33
34## When to Use This Skill
35
36Use this skill whenever an agent must interact with an authenticated SAP web UI, select or inspect a
37browser target, start Edge with loopback CDP, reuse an approved Edge profile, transfer scoped browser
38state to an already-installed compatible client, or recover from browser bootstrap/authentication
39failure. Do not use it for code-only, API-only, CLI-only, or database-native tasks that do not need
40visible browser state.
41
42## Quick Reference
43
44| Need | Route |
45| --- | --- |
46| Manual SSO in the current browser | In-app Browser, then visible signed-in verification |
47| Enterprise Edge or no Playwright installation | Fresh isolated Edge with copied profile and loopback CDP |
48| Independent compatible browser context | Existing Playwright plus scoped `storageState` or CDP state transfer |
49| Missing auth or failed browser bootstrap | User-assisted login, recovery, or specification-only handoff |
50
51## Requested browser and connection are binding
52
53If the user names Chrome, Edge, Chrome DevTools MCP, CDP, or a local DevTools bridge, use only that
54browser and connection method. Do not silently switch to the In-app Browser, a ChatGPT browser
55extension, Playwright, Computer Use, another browser, or shell automation. If the requested surface is
56not available, report the exact blocker and stop at that boundary.
57
58## Operating contract
59
60- Prefer a connector, API, CLI, or database-native check when it can answer the request without a browser.
61- Use the in-app Browser first only when the user has not named a different browser or connection method.
62- Ask the user to authenticate manually in the in-app Browser when its target redirects to SSO. Use its secure authentication capability; never ask for passwords or OTPs in chat.
63- After in-app verification, use the fresh Edge path for reliable automation when the task needs CDP, enterprise extensions, or a reusable profile.
64- Treat MCP configuration and MCP availability as separate checks. After configuration, verify that the server tools are present in the active tool registry. A successful `codex mcp get` check alone does not make the MCP usable.
65- Require a live handshake, such as `list_pages`, and verify that the returned pages belong to the requested browser. If the tools are missing after configuration, ask the user to restart Codex or open a new task before continuing.
66- Ask explicit permission before reusing the user's authenticated normal Edge profile or closing Edge.
67- Copy only after Edge is closed, and copy to an isolated profile path. Treat the copy, cookies, tokens, local storage, and storage-state files as credentials.
68- Bind CDP to `127.0.0.1`; never expose the port, WebSocket endpoint, profile, or auth state to a network, repository, log, screenshot, or Oracle review.
69- Verify the tenant, host, path, title, authenticated DOM, and target page before interaction. Never guess the first tab or target ID.
70- Default to read-only actions. The consuming SAP skill must explicitly authorize writes, publishing, deployment, planning, model, permission, or destructive actions.
71- Browser startup, CDP attachment, or a successful login redirect is not evidence that the requested SAP task completed.
72
73Load the focused references only when needed:
74
75- `references/edge-cdp-control.md` for Edge launch, CDP discovery, target selection, and recovery.
76- `references/auth-state-bootstrap.md` for copying an authenticated Edge profile, exporting scoped state when available, and injecting it into compatible clients.
77- `references/in-app-browser-auth.md` for manual in-app authentication and capability boundaries.
78- Run `scripts/edge-profile.ps1` for deterministic profile cloning, launch, status, and stop operations.
79- Run `scripts/cdp-agent.mjs` for target discovery, inspection, interaction, screenshots, and authentication-state transfer. It requires Node.js 22 or newer and no npm packages.
80
81## Standard workflow
82
83### 1. Classify the task and choose a surface
84
85Record the target application, tenant/host, requested URL, read/write intent, evidence required, and
86whether the user approved profile reuse. Use this order:
87
881. Existing non-browser tool if sufficient.
892. The explicitly requested browser and connection method, after active-tool and live-handshake checks.
903. In-app Browser for visible authenticated UI and manual SSO when no other browser or connection was requested.
914. Fresh isolated Edge with loopback CDP for enterprise browser behavior and reusable authentication.
925. Already-installed Playwright connected over CDP or using local storage state.
936. Approved desktop/manual assistance or a specification-only handoff.
94
95Do not install Playwright, browser binaries, MCP servers, or extensions in an enterprise environment
96unless the user explicitly requests and approves that change. If Playwright is unavailable, Edge/CDP
97remains the primary automation surface.
98
99### 2. Authenticate in the in-app Browser
100
101When no other browser or connection was requested, open the target using the installed Browser skill.
102Inspect visible state. If the page requires SSO, pause for the user to complete the login manually
103through the supported secure auth flow. Verify a positive signed-in signal on the target domain and
104retain a screenshot or equivalent evidence when allowed.
105
106Do not extract cookies, local storage, session storage, profile databases, passwords, or tokens from the
107in-app Browser. Its session is independent from Edge. If it cannot expose an authenticated page after
108manual login, record the failure and continue to the approved Edge path.
109
110This route runs inside Codex or Claude Desktop. Its runtime validation is deferred to those desktop
111environments and is not part of the standalone Edge/CDP acceptance tests.
112
113### 3. Capture live Edge state, then bootstrap fresh Edge
114
115Before touching the user's normal Edge profile, state the intended scope and ask for confirmation:
116
117> I will capture the approved SAP session from the currently authenticated Edge target, close normal Edge, and clone its selected profile into an isolated automation directory. May I continue?
118
119If the user declines, ask them to authenticate once in the isolated profile. If they approve:
120
1211. Identify the normal Edge user-data root, selected `Default` or `Profile N`, target URL, tenant host,
122 target path/title, approved SAP origin, and local temporary state-file path.
1232. While normal Edge is still running and visibly authenticated, open
124 `edge://inspect/#remote-debugging` and enable **Allow remote debugging for this browser instance**.
1253. Run `scripts/cdp-agent.mjs export-auth` against the normal user-data directory. Require host, path,
126 and/or title filters that resolve exactly one approved page. Repeat `--origin` for approved SAP or
127 identity-provider cookie scopes.
1284. Close normal Edge and verify no `msedge.exe` process still owns the source profile.
1295. Run `scripts/edge-profile.ps1 -Action CloneLaunch` with the selected profile name and a new or empty
130 automation root. The helper preserves `Profile N`, refuses non-empty clone destinations, launches
131 with `--remote-debugging-port=0`, and verifies the listener discovered through `DevToolsActivePort`.
1326. Run `scripts/cdp-agent.mjs inspect` and verify tenant, path, title, visible signed-in state, and page readiness.
1337. If cloning lost volatile state, run `scripts/cdp-agent.mjs import-auth` against the isolated target,
134 reload, and repeat the authenticated-state inspection.
1358. If authentication still fails, ask the user to log in once in the isolated profile. Reuse it later
136 with `scripts/edge-profile.ps1 -Action LaunchExisting`; never clone over a populated automation root.
137
138The complete Windows commands, path checks, CDP probes, and recovery matrix are in
139`references/edge-cdp-control.md` and `references/auth-state-bootstrap.md`.
140
141### 4. Operate the verified target
142
143Use the isolated Edge instance directly. Run `scripts/cdp-agent.mjs --help` for the complete command
144surface. The bundled driver supports deterministic targets, inspection/snapshot, navigation,
145evaluation, selector or coordinate clicks, text entry, key presses, screenshots, and auth-state
146export/import without Playwright. Use an existing Playwright installation only when the consuming task
147needs it; do not install it for this workflow.
148
149Authentication transfer uses CDP `Storage.getCookies` and `Storage.setCookies` plus page-scoped
150`localStorage` and `sessionStorage`. Recheck SSO redirects, SameSite behavior, certificates, and visible
151readiness after import. The in-app Browser remains a separate session.
152
153### 5. Verify readiness and perform the domain action
154
155Before changing anything, verify:
156
157- tenant and application identity;
158- authenticated state, not merely a non-login URL;
159- correct Story Designer, Modeler, Data Builder, SQL editor, or test target area;
160- visible readiness markers and absence of blocking errors;
161- approved host/path and selected target page;
162- current model/story/widget metadata when the consuming skill requires it.
163
164Capture page-specific evidence and explicit no-data/error states. Do not treat a spinner disappearing,
165CDP connecting, or a browser window opening as task completion.
166
167### 6. Recover or hand off honestly
168
169Use the following fallback sequence:
170
1711. Retry the selected browser using its documented troubleshooting guidance.
1722. Use the Edge/CDP recovery and `DevToolsActivePort` fallback.
1733. Ask for one-time manual authentication in the isolated Edge profile.
1744. Use approved desktop/manual assistance if the environment supports it.
1755. If no authenticated target can be verified, stop and provide an implementation-ready specification, the exact missing evidence, and the next manual action.
176
177When the user explicitly named a browser or connection method, do not use this sequence to switch to a
178different surface. Stop when the requested surface is unavailable or its live handshake fails.
179
180Report authentication as `verified`, `missing`, `expired`, `blocked`, or `unknown`; never infer success
181from browser bootstrap alone.
182
183## Troubleshooting
184
185Common failures are handled in the shared Edge reference: refused or missing CDP endpoints, `404`
186discovery responses, wrong targets, SSO redirects, copied profiles that are not authenticated, policy
187blocks, and runtime/widget errors. When recovery cannot establish a verified authenticated target,
188stop and hand off the missing evidence rather than guessing or claiming completion.
189
190## Sources and Verification
191
192The public-source review and the distinction between documented behavior and unverified tenant behavior
193are recorded in `docs/project/sap-browser-automation-source-review-2026-07-14.md`.
194
195## Safety and evidence
196
197Profile copies and auth-state files may contain cookies, refresh tokens, saved passwords, history,
198extensions, and enterprise session data. Keep them in a user-local path with restricted access. Do not
199place them under the repository, commit them, send them to Oracle, include them in bug reports, or
200paste their contents into chat. Redact tenant IDs, story IDs, query strings, session-like URL values,
201cookie values, WebSocket endpoints, and unrelated tabs from evidence.
202
203For any write-capable action, record the approving user, target, intended mutation, before/after
204verification, and rollback or cleanup status. The consuming SAP skill remains authoritative for
205whether the action itself is allowed.