SafeGraph AI is a local AI coding assistant project built around an AWS Bedrock-powered VS Code extension. The repository also keeps earlier Bedrock chatbot prototypes for web and Streamlit testing.
- Main product:
safegraph-ai-vscode/ - Current extension version:
0.8.1 - Bedrock region default:
ap-southeast-1 - Authentication: Amazon Bedrock API key from VS Code SecretStorage, environment variables, or local
.env - Packaged builds:
.vsixfiles are stored undersafegraph-ai-vscode/
.
├── safegraph-ai-vscode/ # VS Code extension source and packaged VSIX builds
├── chatbot-web/ # Flask web chatbot prototype using Bedrock API keys
├── src/ # Streamlit app and credential setup scripts
├── docs/ # Setup, credential, and usage notes
├── config/ # Python requirements and env examples
├── examples/ # Bedrock usage examples
└── README.md # This file
The extension provides:
- Sidebar chat view inside VS Code
- Bedrock chat integration
- Local repository context/RAG
- Inline edit command with
Cmd+Kon macOS orCtrl+Kon Windows/Linux - Accept/reject inline edits with
Cmd/Ctrl+EnterandEsc - Safe command auto-run setting for agent workflows
Use the latest package in safegraph-ai-vscode/, for example:
code --install-extension safegraph-ai-vscode/safegraph-ai-0.8.1.vsix --forceOr in VS Code:
Extensions: Install from VSIX...
cd safegraph-ai-vscode
npm install
npm run buildOpen safegraph-ai-vscode/ in VS Code and press F5 to launch an Extension Development Host.
cd safegraph-ai-vscode
npm run packageThe extension checks for a Bedrock API key in this order:
- Environment variables:
AWS_BEARER_TOKEN_BEDROCK,API_KEY,BEDROCK_API_KEY,AWS_BEDROCK_API_KEY - Workspace
.envfiles - VS Code SecretStorage via
Safegraph AI: Set Bedrock API Key
Recommended local .env format:
API_KEY="bedrock-api-key-..."
ARN="arn:aws:bedrock:ap-southeast-1:ACCOUNT_ID:application-inference-profile/PROFILE_ID"Do not commit real .env files or real API keys.
The Flask prototype lives in chatbot-web/.
cd chatbot-web
pip install -r requirements.txt
python app.pyDefault URL:
http://localhost:5001
It reads credentials from the repo root .env and chatbot-web/.env.
The older Streamlit app is still available under src/.
pip install -r config/requirements.txt
streamlit run src/app.pyCredential helper:
python src/setup_credentials.py- Real API keys must stay out of Git.
.envfiles are ignored and should remain local.- Prefer VS Code SecretStorage for the extension.
- Rotate/revoke any key that was shared, logged, or committed.
- After rewriting history, avoid merging old remote branches back into clean branches.
See LICENSE.