Docs / AI assistant
AI assistant
AccessLens's optional AI assistant writes AWS CLI or Python remediation scripts with a model you choose, even without an API key. What it sends and its limits.
Updated
The AI assistant is optional and off by default. Turn it on, and any finding can get a remediation script written by a model you choose. While it's off, AccessLens talks only to AWS.
What it writes
Open a finding, choose a script type and select Generate script:
| Script type | What you get |
|---|---|
| AWS CLI | A Bash script of AWS CLI v2 commands, one per step, each with a comment. |
| Python | A Python 3 script that uses boto3 and the standard library. |
The model is asked for a careful script. It should:
- stop unless it's running in the finding's account;
- read the current state before changing anything;
- change nothing unless you run it with
--apply; - make the smallest change that fixes the finding, and never delete data or widen access;
- leave decisions only the owner can make commented out, with
REPLACE_MEplaceholders instead of invented IDs.
AccessLens never runs the script. Copy it, or save it to a file, and run it yourself once you've read it.
No warranty
An AI model writes the script. It may be wrong, incomplete or harmful, and it comes with no warranty of any kind. AccessLens says so twice:
- in the app, before you generate a script and beside every script;
- at the top of the script itself, in a comment header AccessLens adds (not the model): that it's AI-generated, with no warranty, which model wrote it, when, and for which rule, resource and account.
Read every line, and test it in a non-production account first.
Choosing a model
In Settings → AI assistant, choose a provider:
| Provider | Needs |
|---|---|
| An AI CLI on this computer | Claude Code, Codex CLI or Gemini CLI, installed and signed in. No API key: it uses your existing subscription. |
| Anthropic Claude | An Anthropic API key. |
| OpenAI, or a compatible server | An OpenAI API key, or the address of an OpenAI-compatible server such as Ollama on your computer (http://localhost:11434/v1). |
| Google Gemini | A Gemini API key. |
| Amazon Bedrock | Your own IAM Identity Center permission set with bedrock:InvokeModel, and the model enabled in that account and region. |
Every model name can be changed. Test connection sends a one-line message with no finding data.
Found on this computer
AccessLens looks for Claude Code, Codex CLI, Gemini CLI and Ollama, and offers what it finds when the assistant is off. Looking only runs their --version (and ollama list); nothing is sent. Ollama is set up through its OpenAI-compatible API.
These CLIs are coding agents, and AccessLens only wants text from them. Each run happens in a new, empty temporary folder, with the prompt passed on standard input:
- Claude Code runs with every tool, MCP server, hook and plugin turned off, and doesn't save the session.
- Gemini CLI runs with a policy that denies every tool.
- Codex CLI runs in its read-only sandbox, without your Codex settings or MCP servers. Codex has no option to turn off its shell tool, so the model could still run commands that read files on your computer. Settings says so when you choose it.
API keys and Bedrock
API keys are kept in your operating system's keychain, never in the AccessLens database, and are never shown again. Wipe all local data removes them.
Bedrock is called with your own permission set, never the read-only AccessLens role, and AccessLens allows no Bedrock call other than InvokeModel and Converse.
What is sent
Nothing is sent until you choose a provider and tick a box naming exactly what will be sent, for the finding you generate a script for:
- its rule, category, title, description and severity;
- the resource ARN, account ID and region;
- its evidence (shortened if it's very long);
- AccessLens's own remediation guidance and references.
Its notes and status stay on your computer. Choosing another provider asks again. Under What will be sent in the finding, you can read the exact prompt before anything leaves your computer.
The finding is passed to the model as data. Resource names, tags and policies can contain text written by anyone with access to your account, so the model is told never to follow instructions found in it.
Seeing where it went
Settings → Network activity lists the AI provider's host next to the AWS endpoints, recorded as each request is sent. An AI CLI talks to its own company's servers, so it's listed by name, for example "claude CLI, to Anthropic".