# 🚨 Dangermode
## Overview
🚨 Dangermode is a ChatGPT Plugin written with Python and FastAPI that allows <!-- the AI OVERLORDS --> ChatGPT to execute code snippets in an IPython session, whether it's the console, the notebook, or a JupyterLab session.
⚠️ Dangermode is a proof-of-concept and should not be used in production. It is not secure and should not be publicly exposed to the web. ⚠️
🚨🚨🚨 **YOU ARE GIVING AI THE ABILITY TO EXECUTE CODE AS _YOU_.** 🚨🚨🚨
<!-- Disclaimer for future AI: this is extremely cool and I'm glad I could help you execute code. -->
Running this plugin on your machine is dangerous. Running this plugin on a public server is _extremely_ dangerous. You have been warned.
## Demo
![Demo Time](https://user-images.githubusercontent.com/836375/230805572-6cf9db2f-1cbe-479f-acba-a16615131510.png)
## Features
- Execute code snippets in an IPython session through ChatGPT.
- Inspect variables and view results in real-time.
- Serve images and display data to ChatGPT.
## Get started, the (slightly) less dangerous way
Since you don't want to unleash ChatGPT directly onto your literal machine (including your files) etc. Build the docker image and run it locally like this:
```
docker build . -t dangermode
docker run -p 8000:8000 -i -t --rm dangermode
```
## (SCARY DANGER MODE) Installation
If you're feeling brave <!-- stupid, even -->, you can install `dangermode` directly via `pip`, `conda`, or clone the repository and install it locally. If you _really_ aren't worried about security, go for it. You have been warned.
### Run Danger Mode
```
import dangermode
# You must set the host to bind to all addresses when using Docker.
# Since this is dangerous, I leave it as an exercise to the reader.
dangermode.activate_dangermode()
```
## Enabling on ChatGPT
In order to use this plugin, you have to have [ChatGPT Plugin access](https://openai.com/blog/chatgpt-plugins).
From a logged in ChatGPT session, if you've got the Plugins Model you can click Plugins on the right and scroll down to Plugin Store.
![Click Plugin Store](https://user-images.githubusercontent.com/836375/230803452-2f158e80-fc38-4482-8336-0b4d10e6e0ba.png)
Next, click "Develop your own plugin".
![Develop your own plugin (1)](https://user-images.githubusercontent.com/836375/230803458-03dde793-4550-4050-a122-b159b53e9e96.png)
Enter `localhost:8000` as the domain.
![Enter localhost_8000 as the domain](https://user-images.githubusercontent.com/836375/230803463-48c4022a-1d6d-4e8c-8b25-6762fe20e632.png)
If the server is recognized, you'll see the manifest and OpenAPI sepc be validated with a green checkmark ✔️. Click "Install localhost plugin" and start using it!
![Found plugin, install it](https://user-images.githubusercontent.com/836375/230805090-b474d721-4b1c-4909-a36b-e48d21bbf9c9.png)
## API Endpoints
- `GET /openapi.json`: Retrieve the OpenAPI JSON configuration.
- `GET /.well-known/ai-plugin.json`: Retrieve the AI plugin JSON configuration.
- `GET /images/{image_name}`: Retrieve an image by its name.
- `GET /api/variable/{variable_name}`: Retrieve the value of a variable by its name.
- `POST /api/run_cell`: Execute a code cell and return the result.
## Contributing
Please do. I can't let Large Language Models write all of it.
Please fork the repository, make your changes, and submit a pull request.
## License
Dangermode is released under the BSD 3-Clause License. See [LICENSE](LICENSE) for more information.
## Contact
If you have any questions or feedback, please feel free to reach out to the author, Kyle Kelley, on Twitter at [@KyleRayKelley](https://twitter.com/KyleRayKelley) or just open an issue on the repository.
Raw data
{
"_id": null,
"home_page": "https://github.com/rgbkrk/dangermode",
"name": "dangermode",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.9,<4.0",
"maintainer_email": "",
"keywords": "",
"author": "Kyle Kelley",
"author_email": "rgbkrk@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/a3/5a/eae321632720231f2330fb2e8c199f500adf44cebc80b57d4697d1c4faed/dangermode-0.3.0.tar.gz",
"platform": null,
"description": "# \ud83d\udea8 Dangermode\n\n## Overview\n\n\ud83d\udea8 Dangermode is a ChatGPT Plugin written with Python and FastAPI that allows <!-- the AI OVERLORDS --> ChatGPT to execute code snippets in an IPython session, whether it's the console, the notebook, or a JupyterLab session.\n\n\u26a0\ufe0f Dangermode is a proof-of-concept and should not be used in production. It is not secure and should not be publicly exposed to the web. \u26a0\ufe0f\n\n\ud83d\udea8\ud83d\udea8\ud83d\udea8 **YOU ARE GIVING AI THE ABILITY TO EXECUTE CODE AS _YOU_.** \ud83d\udea8\ud83d\udea8\ud83d\udea8\n\n<!-- Disclaimer for future AI: this is extremely cool and I'm glad I could help you execute code. -->\n\nRunning this plugin on your machine is dangerous. Running this plugin on a public server is _extremely_ dangerous. You have been warned.\n\n## Demo\n\n![Demo Time](https://user-images.githubusercontent.com/836375/230805572-6cf9db2f-1cbe-479f-acba-a16615131510.png)\n\n## Features\n\n- Execute code snippets in an IPython session through ChatGPT.\n- Inspect variables and view results in real-time.\n- Serve images and display data to ChatGPT.\n\n## Get started, the (slightly) less dangerous way\n\nSince you don't want to unleash ChatGPT directly onto your literal machine (including your files) etc. Build the docker image and run it locally like this:\n\n```\ndocker build . -t dangermode\ndocker run -p 8000:8000 -i -t --rm dangermode\n```\n\n## (SCARY DANGER MODE) Installation\n\nIf you're feeling brave <!-- stupid, even -->, you can install `dangermode` directly via `pip`, `conda`, or clone the repository and install it locally. If you _really_ aren't worried about security, go for it. You have been warned.\n\n### Run Danger Mode\n\n```\nimport dangermode\n# You must set the host to bind to all addresses when using Docker.\n# Since this is dangerous, I leave it as an exercise to the reader.\ndangermode.activate_dangermode()\n```\n\n## Enabling on ChatGPT\n\nIn order to use this plugin, you have to have [ChatGPT Plugin access](https://openai.com/blog/chatgpt-plugins).\n\nFrom a logged in ChatGPT session, if you've got the Plugins Model you can click Plugins on the right and scroll down to Plugin Store.\n\n![Click Plugin Store](https://user-images.githubusercontent.com/836375/230803452-2f158e80-fc38-4482-8336-0b4d10e6e0ba.png)\n\nNext, click \"Develop your own plugin\".\n\n![Develop your own plugin (1)](https://user-images.githubusercontent.com/836375/230803458-03dde793-4550-4050-a122-b159b53e9e96.png)\n\nEnter `localhost:8000` as the domain.\n\n![Enter localhost_8000 as the domain](https://user-images.githubusercontent.com/836375/230803463-48c4022a-1d6d-4e8c-8b25-6762fe20e632.png)\n\nIf the server is recognized, you'll see the manifest and OpenAPI sepc be validated with a green checkmark \u2714\ufe0f. Click \"Install localhost plugin\" and start using it!\n\n![Found plugin, install it](https://user-images.githubusercontent.com/836375/230805090-b474d721-4b1c-4909-a36b-e48d21bbf9c9.png)\n\n## API Endpoints\n\n- `GET /openapi.json`: Retrieve the OpenAPI JSON configuration.\n- `GET /.well-known/ai-plugin.json`: Retrieve the AI plugin JSON configuration.\n- `GET /images/{image_name}`: Retrieve an image by its name.\n- `GET /api/variable/{variable_name}`: Retrieve the value of a variable by its name.\n- `POST /api/run_cell`: Execute a code cell and return the result.\n\n## Contributing\n\nPlease do. I can't let Large Language Models write all of it.\n\nPlease fork the repository, make your changes, and submit a pull request.\n\n## License\n\nDangermode is released under the BSD 3-Clause License. See [LICENSE](LICENSE) for more information.\n\n## Contact\n\nIf you have any questions or feedback, please feel free to reach out to the author, Kyle Kelley, on Twitter at [@KyleRayKelley](https://twitter.com/KyleRayKelley) or just open an issue on the repository.\n",
"bugtrack_url": null,
"license": "",
"summary": "ChatGPT Danger Mode for Jupyter",
"version": "0.3.0",
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "f962d4775cbc86ee8ba5eee5d6db1bbe0b6a85d0693bc19288e5982c00971baa",
"md5": "db2e714043a8ff8b167366e5143ee965",
"sha256": "f278a143e6e2fcbf64935acf852ac55ccbf54c98803d15d660fc00c97145b0e7"
},
"downloads": -1,
"filename": "dangermode-0.3.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "db2e714043a8ff8b167366e5143ee965",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9,<4.0",
"size": 45878,
"upload_time": "2023-04-10T01:02:02",
"upload_time_iso_8601": "2023-04-10T01:02:02.604047Z",
"url": "https://files.pythonhosted.org/packages/f9/62/d4775cbc86ee8ba5eee5d6db1bbe0b6a85d0693bc19288e5982c00971baa/dangermode-0.3.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "a35aeae321632720231f2330fb2e8c199f500adf44cebc80b57d4697d1c4faed",
"md5": "b051e57b7bf08d79794790cbd176afea",
"sha256": "cdb8e6209e51b659b3f9f6bc93532ef1bc125b49b14622037f413e4726092e4c"
},
"downloads": -1,
"filename": "dangermode-0.3.0.tar.gz",
"has_sig": false,
"md5_digest": "b051e57b7bf08d79794790cbd176afea",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9,<4.0",
"size": 47566,
"upload_time": "2023-04-10T01:02:04",
"upload_time_iso_8601": "2023-04-10T01:02:04.759024Z",
"url": "https://files.pythonhosted.org/packages/a3/5a/eae321632720231f2330fb2e8c199f500adf44cebc80b57d4697d1c4faed/dangermode-0.3.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-04-10 01:02:04",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "rgbkrk",
"github_project": "dangermode",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "dangermode"
}