{"id":26421100,"url":"https://github.com/agentoverlay/agentic-browser-context-injection-demo","last_synced_at":"2026-01-03T23:04:23.305Z","repository":{"id":277593916,"uuid":"932921454","full_name":"agentoverlay/agentic-browser-context-injection-demo","owner":"agentoverlay","description":"Demo of context injection by an AI Agent to creator browser based authorization flows during browser hijacking session by AI","archived":false,"fork":false,"pushed_at":"2025-02-14T20:52:05.000Z","size":23,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-03-09T13:02:08.425Z","etag":null,"topics":["agent","agentic-ai","context-injection","demo","operator","toy-example"],"latest_commit_sha":null,"homepage":"","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/agentoverlay.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-02-14T19:12:09.000Z","updated_at":"2025-02-14T20:52:08.000Z","dependencies_parsed_at":"2025-02-14T20:23:24.297Z","dependency_job_id":"323111de-6178-47d2-ab9c-c07b6213af0c","html_url":"https://github.com/agentoverlay/agentic-browser-context-injection-demo","commit_stats":null,"previous_names":["madesm/agentic-browser-context-injection-demo","agentoverlay/agentic-browser-context-injection-demo"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agentoverlay%2Fagentic-browser-context-injection-demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agentoverlay%2Fagentic-browser-context-injection-demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agentoverlay%2Fagentic-browser-context-injection-demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agentoverlay%2Fagentic-browser-context-injection-demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/agentoverlay","download_url":"https://codeload.github.com/agentoverlay/agentic-browser-context-injection-demo/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244141539,"owners_count":20404836,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["agent","agentic-ai","context-injection","demo","operator","toy-example"],"created_at":"2025-03-18T02:01:24.837Z","updated_at":"2026-01-03T23:04:23.232Z","avatar_url":"https://github.com/agentoverlay.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Authorization Demo\n\nThis demo project shows how to conditionally run an authorization process based\non whether a context is injected into the browser. When no context is injected,\nclicking the \"Click Me!\" button performs a normal action. When context is\ninjected (via the console), clicking the button triggers an authorization\nprocess that requires terminal-based human approval on the backend.\n\nSee the demo [here](https://youtu.be/jbOWS2KHTGk)\n\nThe idea is that agentic operators (like OpenAI) \nwould inject a context into their browser session to navigate the web more safely.\n\nWebsites could listen to this context and use it to trigger various authorization flows\non behalf of the user. \n\nNot explored but possible, Agents could only use websites that say they are ai agent ready.\nAdditional context could be provided for these interactions for the agents, resulting in mutual information exchange. \n\nThis could be an easy way for Agents to use only safe websites and navigate on behalf of the consumer. \n\n## Overview\n\n### Front-End (HTML + JavaScript)\n\n- **Context Injection:**  \n  A helper function (`injectContext()`) is available in the browser console.\n  Running this function injects a global context (`window.myAppContext`) with\n  details like user ID, session token, and requested scope.\n\n- **Button Behavior:**  \n  The page dynamically creates a \"Click Me!\" button.  \n  - **Without injected context:** Clicking the button executes a normal action\n    (e.g., displaying an alert).\n  - **With injected context:** Clicking the button sends a POST request to a\n    backend endpoint (`/authorize`) with the context. The backend then requires\n    human (terminal) approval before proceeding with the secure action.\n\n### Back-End (Node.js with Express \u0026 Terminal Approval)\n\n- **Server Functionality:**  \n  The Node.js backend listens on port 3005 and exposes an `/authorize` endpoint.\n  \n- **Terminal-Based Approval:**  \n  When an authorization request is received, the backend prints the request details to the terminal and uses the Node `readline` module to prompt the operator for approval.  \n  - Typing `yes` approves the request.\n  - Typing `no` denies the request.\n\n- **Response:**  \n  The backend responds with a JSON object indicating whether the request was\n  authorized (`{ authorized: true }` or `{ authorized: false }`).\n\n## Getting Started\n\n### Prerequisites\n\n- **Node.js:** Ensure Node.js is installed on your system.\n- **Browser:** Any modern browser (Chrome, Firefox, etc.) to open the front-end\n  HTML page.\n\n### Back-End Setup\n\n1. **Create and Initialize the Project:**\n\n   ```bash mkdir authorization-backend cd authorization-backend npm init -y npm\n   install express body-parser\n\n## What's Next:\n\nThis is a super simple proof of context. There's a lot of work to do to build the context layer and to provide tooling for services to integrate it with their website.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagentoverlay%2Fagentic-browser-context-injection-demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fagentoverlay%2Fagentic-browser-context-injection-demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagentoverlay%2Fagentic-browser-context-injection-demo/lists"}