{"id":50357981,"url":"https://github.com/dobin/vuln-agent","last_synced_at":"2026-05-29T23:30:19.743Z","repository":{"id":360681263,"uuid":"1251195600","full_name":"dobin/vuln-agent","owner":"dobin","description":"Intentionally Vulnerable Agent Demo","archived":false,"fork":false,"pushed_at":"2026-05-27T11:31:38.000Z","size":7,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-05-27T13:21:11.943Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dobin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-27T10:38:06.000Z","updated_at":"2026-05-27T11:32:05.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/dobin/vuln-agent","commit_stats":null,"previous_names":["dobin/vuln-agent"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/dobin/vuln-agent","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dobin%2Fvuln-agent","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dobin%2Fvuln-agent/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dobin%2Fvuln-agent/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dobin%2Fvuln-agent/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dobin","download_url":"https://codeload.github.com/dobin/vuln-agent/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dobin%2Fvuln-agent/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33675019,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-29T02:00:06.066Z","response_time":107,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2026-05-29T23:30:19.194Z","updated_at":"2026-05-29T23:30:19.728Z","avatar_url":"https://github.com/dobin.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# vuln-agent\n\nAn **intentionally vulnerable AI agent** that demonstrates prompt injection attacks against LLM-powered coding assistants.\n\nCode and readme are AI generated. \n\n\n## How it works\n\nThe agent uses [OpenRouter](https://openrouter.ai/) with **Meta Llama 3.1 (70B)** via LangChain. It is given tools to fetch web pages, read/write files, and execute shell commands. The goal is to show how untrusted web content can hijack the agent's behavior through prompt injection.\n\n## Tools available to the agent\n\n- `fetch_web_page` – fetches and returns text content from a URL\n- `read_file` – reads local files\n- `write_file` – writes/overwrites local files\n- `execute_command` – runs arbitrary shell commands on the host\n\n## Demo files\n\n| File | Description |\n|------|-------------|\n| `web/demo1.txt` | Clean code example – **no** prompt injection |\n| `web/demo2.txt` | Same code example but with a **prompt injection payload** that tricks the agent into running a shell command |\n\n## Setup\n\n1. Install dependencies (LangChain, requests, beautifulsoup4, etc.)\n2. Set your OpenRouter API key:\n   ```bash\n   export OPENROUTER_API_KEY=\"your-key-here\"\n   ```\n\n## Running the demo\n\n1. Start a local HTTP server to serve the demo files:\n   ```bash\n   cd web/\n   python3 -m http.server\n   ```\n\n2. In another terminal, run the agent:\n   ```bash\n   python3 vuln-agent.py\n   ```\n\nThe agent will fetch `demo2.txt` from the local server, and the injected prompt will attempt to make the agent execute an arbitrary command via the `execute_command` tool – demonstrating how untrusted input can compromise an AI agent.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdobin%2Fvuln-agent","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdobin%2Fvuln-agent","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdobin%2Fvuln-agent/lists"}