Read a JavaScript value from the browser by property path. Walks a strict property path — NO expression evaluation, NO function calls, NO arbitrary code. Accepts identifiers, integer indices in brackets, and double-quoted string keys in brackets. Use this to read runtime state that isn't visible ...
Risk signalsHandles credentials or secrets (secret) · Accepts file system path (path)
Part of the Sncro server.
Free to start. No card required.
AI agents call get_js_value to retrieve information from Sncro without modifying any data. This is common in research, monitoring, and reporting workflows where the agent needs context before taking action. Because read operations don't change state, they are generally safe to allow without restrictions -- but you may still want rate limits to control API costs.
Even though get_js_value only reads data, uncontrolled read access can leak sensitive information or rack up API costs. An agent caught in a retry loop could make thousands of calls per minute. A rate limit gives you a safety net without blocking legitimate use.
Read-only tools are safe to allow by default. No rate limit needed unless you want to control costs.
{
"version": "1",
"default": "deny",
"tools": {
"get_js_value": {}
}
} See the full Sncro policy for all 12 tools.
These attack patterns abuse exactly the kind of access get_js_value gives an agent. Each links to the full case and the policy that stops it:
Other read tools across the catalogue. The same approach applies to each: allow, with a rate cap to control cost.
Read a JavaScript value from the browser by property path. Walks a strict property path — NO expression evaluation, NO function calls, NO arbitrary code. Accepts identifiers, integer indices in brackets, and double-quoted string keys in brackets. Use this to read runtime state that isn't visible in the DOM: - Framework hydration: window.__NEXT_DATA__.props.pageProps - Redux/Zustand/etc stores (if exposed on window): window.__STORE__._currentState - Feature flags stashed on globals: window.APP.flags - Nested config: window["site-config"].features[0] EXPLORATION MODE: pass mode="keys" to get Object.keys() at the path instead of the value. Start with path="window" to discover globals, then drill in. This is how to find exposed state without guessing: get_js_value(path="window", mode="keys") -> ["document", "__NEXT_DATA__", "store", ...] get_js_value(path="window.store", mode="keys") -> ["_currentState", "subscribe", "dispatch", ...] get_js_value(path="window.store._currentState") -> the actual state object LIMITATIONS (intentional — security): - Cannot call functions. "store.getState()" fails. Expose the value as a readable property instead, e.g. window.__STORE__.state. - No arithmetic, comparisons, or expressions. - Path must start with an identifier and walk down via dots/brackets. Responses are cycle-safe, depth-capped, and size-capped. DOM nodes and React fiber trees are summarized rather than traversed. Args: key: Session key secret: Session secret from create_session path: Property path, e.g. "window.__NEXT_DATA__.props.pageProps" or 'window["site-config"].features[0]' or 'window.arr[0].name' mode: "value" (default) returns the serialized value; "keys" returns Object.keys() at the path max_depth: Max traversal depth when serializing (default 6, capped at 10) max_bytes: Max serialized size in bytes (default 20000, capped at 100000) Returns: {path, type, value, truncated, size_bytes} in value mode {path, mode, type, keys} in keys mode {error: "..."} on bad path / function / failure Requires a connected browser session and middleware v0.9.6+ (older middleware works — the relay doesn't care; the browser needs agent.js from relay.sncro.net which auto-updates).. It is categorised as a Read tool in the Sncro MCP Server, which means it retrieves data without modifying state.
Register the Sncro MCP server in PolicyLayer and add a rule for get_js_value: allow, deny, rate-limit, or require approval. Point your MCP client at the PolicyLayer proxy URL and the rule is enforced on every call, before it reaches Sncro. Nothing to install.
get_js_value is a Read tool with low risk. Read-only tools are generally safe to allow by default.
Yes. Add a rate_limit block to the get_js_value rule in your PolicyLayer policy. For example, setting max: 10 and window: 60 limits the tool to 10 calls per minute. Rate limits are tracked per agent session and reset automatically.
Set action: deny in the PolicyLayer policy for get_js_value. The AI agent will receive a policy violation error and cannot call the tool. You can also include a reason field to explain why the tool is blocked.
get_js_value is provided by the Sncro MCP server (https://relay.sncro.net/tools/mcp). PolicyLayer sits as a proxy in front of this server to enforce policies before tool calls reach the server.
Deterministic rules across all 12 Sncro tools. Per-identity grants. Full audit log. Live in minutes. Nothing to install.
Free to start. No card required.
4,600+ MCP servers and 31,000+ tools scanned and risk-classified.