<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Daniel Skov Jacobsen</title>
    <description>The latest articles on DEV Community by Daniel Skov Jacobsen (@dsjacobsen).</description>
    <link>https://dev.to/dsjacobsen</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3754409%2Ffc041482-ccd3-4db1-b429-1399675dc367.png</url>
      <title>DEV Community: Daniel Skov Jacobsen</title>
      <link>https://dev.to/dsjacobsen</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/dsjacobsen"/>
    <language>en</language>
    <item>
      <title>I built an Open-Source CLI that stops your AI terminal from leaking secrets</title>
      <dc:creator>Daniel Skov Jacobsen</dc:creator>
      <pubDate>Thu, 05 Feb 2026 19:50:04 +0000</pubDate>
      <link>https://dev.to/dsjacobsen/i-built-an-open-source-cli-that-stops-your-ai-terminal-from-leaking-secrets-4ocb</link>
      <guid>https://dev.to/dsjacobsen/i-built-an-open-source-cli-that-stops-your-ai-terminal-from-leaking-secrets-4ocb</guid>
      <description>&lt;p&gt;I love AI coding tools. I use them every day. But there's a thing nobody building them seems to care about: everything you send goes straight to the model, unfiltered.&lt;/p&gt;

&lt;p&gt;Your command history. Your environment variables. Credentials, tokens, customer data sitting in error logs. None of it gets redacted. There's no audit trail. You just have to trust that nothing sensitive slipped into your prompt.&lt;/p&gt;

&lt;p&gt;That's not a great security posture. So I built something.&lt;/p&gt;

&lt;h2&gt;
  
  
  The quiet risk in AI-Powered dev workflows
&lt;/h2&gt;

&lt;p&gt;AI terminal assistants are incredible for productivity. I use one constantly. But most of them work like this:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Your full prompt → LLM API → response back&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;No filtering. No redaction. No audit trail.&lt;/p&gt;

&lt;p&gt;That means if your prompt context includes credentials from command history, PII from error logs, internal hostnames from your environment, or tokens from your clipboard, it all goes to the model.&lt;/p&gt;

&lt;p&gt;For side projects? Who cares. But the moment you're working with production systems, customer data, or proprietary code, this becomes a real compliance problem. Especially if you're in a regulated industry or working with enterprise clients.&lt;/p&gt;

&lt;h2&gt;
  
  
  So I built: Bast CLI
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/bastio-ai/bast" rel="noopener noreferrer"&gt;&lt;strong&gt;Bast&lt;/strong&gt;&lt;/a&gt; is a free, open-source AI terminal assistant that routes through a security gateway before anything reaches the LLM.&lt;/p&gt;

&lt;p&gt;It does everything you'd expect from an AI CLI: Natural language to shell commands, command explanation, error recovery, but with a security layer that:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Redacts PII automatically&lt;/strong&gt; before it hits the model (emails, API keys, credentials, tokens)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Blocks prompt injection&lt;/strong&gt; and jailbreak attempts&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Logs everything&lt;/strong&gt; so you have full observability on what's being sent and when&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It's written in Go, uses &lt;a href="https://github.com/charmbracelet/bubbletea" rel="noopener noreferrer"&gt;Bubble Tea&lt;/a&gt; for the TUI, and is MIT licensed.&lt;/p&gt;

&lt;h2&gt;
  
  
  See It in Action
&lt;/h2&gt;

&lt;p&gt;Here's a quick walkthrough:&lt;/p&gt;

&lt;p&gt;

&lt;/p&gt;
&lt;div class="crayons-card c-embed text-styles text-styles--secondary"&gt;
    &lt;div class="c-embed__content"&gt;
        &lt;div class="c-embed__cover"&gt;
          &lt;a href="https://screen.studio/share/oBN8ny14" class="c-link align-middle" rel="noopener noreferrer"&gt;
            &lt;img alt="" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fscreen-studio-shareable-links.67aa83ffa7fb557cd114a7156fca4e73.r2.cloudflarestorage.com%2FoBN8ny14-thumbnail.jpg%3FX-Amz-Algorithm%3DAWS4-HMAC-SHA256%26X-Amz-Content-Sha256%3DUNSIGNED-PAYLOAD%26X-Amz-Credential%3D363e5c20253db1195c87384f6dfb4c99%252F20260323%252Fauto%252Fs3%252Faws4_request%26X-Amz-Date%3D20260323T055650Z%26X-Amz-Expires%3D604800%26X-Amz-Signature%3Dc1b09b1df9f3aa89c4fd98021722ec89335ebf049fbd1d1b3f75dc0bb5f1bd7e%26X-Amz-SignedHeaders%3Dhost%26x-id%3DGetObject" height="auto" class="m-0"&gt;
          &lt;/a&gt;
        &lt;/div&gt;
      &lt;div class="c-embed__body"&gt;
        &lt;h2 class="fs-xl lh-tight"&gt;
          &lt;a href="https://screen.studio/share/oBN8ny14" rel="noopener noreferrer" class="c-link"&gt;
            Bastio AI Security | BAST CLI Tool — Screen Studio
          &lt;/a&gt;
        &lt;/h2&gt;
          &lt;p class="truncate-at-3"&gt;
            Bastio AI Security | BAST CLI Tool — Created and shared with Screen Studio
          &lt;/p&gt;
        &lt;div class="color-secondary fs-s flex items-center"&gt;
            &lt;img alt="favicon" class="c-embed__favicon m-0 mr-2 radius-0" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fscreen.studio%2Ficon.png"&gt;
          screen.studio
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;




&lt;p&gt;&lt;strong&gt;Install&lt;/strong&gt; (macOS / Linux):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-fsSL&lt;/span&gt; https://raw.githubusercontent.com/bastio-ai/bast/main/scripts/install.sh | sh
bast init
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Generate commands from plain English:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;bast run
&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; find all go files modified &lt;span class="k"&gt;in &lt;/span&gt;the last week

find &lt;span class="nb"&gt;.&lt;/span&gt; &lt;span class="nt"&gt;-name&lt;/span&gt; &lt;span class="s2"&gt;"*.go"&lt;/span&gt; &lt;span class="nt"&gt;-mtime&lt;/span&gt; &lt;span class="nt"&gt;-7&lt;/span&gt;

&lt;span class="o"&gt;[&lt;/span&gt;⏎ Run] &lt;span class="o"&gt;[&lt;/span&gt;e Edit] &lt;span class="o"&gt;[&lt;/span&gt;c Copy] &lt;span class="o"&gt;[&lt;/span&gt;? Explain] &lt;span class="o"&gt;[&lt;/span&gt;Esc Exit]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Understand a command before you run it:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;bast explain &lt;span class="s2"&gt;"tar -xzvf archive.tar.gz"&lt;/span&gt;

Extracts a gzip-compressed &lt;span class="nb"&gt;tar &lt;/span&gt;archive. The flags: &lt;span class="nv"&gt;x&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;extract,
&lt;span class="nv"&gt;z&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;decompress &lt;span class="nb"&gt;gzip&lt;/span&gt;, &lt;span class="nv"&gt;v&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;verbose output, &lt;span class="nv"&gt;f&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;specify filename.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Fix a failed command:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;git push origin feature/auth
&lt;span class="o"&gt;!&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt;rejected] feature/auth -&amp;gt; feature/auth &lt;span class="o"&gt;(&lt;/span&gt;non-fast-forward&lt;span class="o"&gt;)&lt;/span&gt;

&lt;span class="nv"&gt;$ &lt;/span&gt;bast fix
The remote branch has commits you don&lt;span class="s1"&gt;'t have locally.
Suggested fix:
  git pull --rebase origin feature/auth
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Beyond the security layer
&lt;/h2&gt;

&lt;p&gt;Bast isn't just a security wrapper - it's a full-featured AI terminal assistant. A few highlights:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Dangerous command detection&lt;/strong&gt; — automatically warns before &lt;code&gt;rm -rf&lt;/code&gt;, &lt;code&gt;git push --force&lt;/code&gt;, &lt;code&gt;dd&lt;/code&gt;, and other destructive operations. There's a full list of protected git operations, including force push, hard reset, branch deletion, and history rewriting.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Git awareness&lt;/strong&gt; — knows your current branch, staged changes, merge/rebase state, and recent commits. When you ask it to "commit my changes with a good message," it actually reads your diff to write something meaningful.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Agentic mode&lt;/strong&gt; — type &lt;code&gt;/agent&lt;/code&gt; for multi-step tasks. Bast can execute commands, read files, and iterate to complete complex workflows:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;bast run
&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; /agent find all TODO comments &lt;span class="k"&gt;in &lt;/span&gt;go files and summarize them

Tool Calls:
  run_command &lt;span class="o"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"command"&lt;/span&gt;: &lt;span class="s2"&gt;"grep -r 'TODO' --include='*.go' ."&lt;/span&gt;&lt;span class="o"&gt;}&lt;/span&gt;

Found 2 TODO comments &lt;span class="k"&gt;in &lt;/span&gt;the codebase:
1. internal/ai/anthropic.go — Add streaming support &lt;span class="k"&gt;for &lt;/span&gt;responses
2. internal/tools/loader.go — Validate script permissions before execution
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Shell integration&lt;/strong&gt; — add &lt;code&gt;eval "$(bast hook zsh)"&lt;/code&gt; to your config and get &lt;code&gt;Ctrl+A&lt;/code&gt; to launch bast and &lt;code&gt;Ctrl+E&lt;/code&gt; to explain whatever command you're currently typing.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Custom plugins&lt;/strong&gt; — extend bast with your own tools using simple YAML manifests in &lt;code&gt;~/.config/bast/tools/&lt;/code&gt;. Great for deployment pipelines, database operations, or any workflow you want to make AI-aware.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Gateway (and How to Skip It)
&lt;/h2&gt;

&lt;p&gt;The Bastio security gateway is free for 100,000 requests/month. No credit card required. It handles PII redaction, injection blocking, and observability.&lt;/p&gt;

&lt;p&gt;If you'd rather connect directly to the Anthropic API:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;ANTHROPIC_API_KEY&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;sk-ant-...
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;BAST_GATEWAY&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;direct
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You lose the security features, but everything else works.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Open Source?
&lt;/h2&gt;

&lt;p&gt;This is simple: if a tool claims to protect your data, you should be able to read the code. A closed-source security tool is a contradiction.&lt;/p&gt;

&lt;p&gt;The entire CLI is on GitHub under MIT. Read it, fork it, break it, improve it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;→ &lt;a href="https://github.com/bastio-ai/bast" rel="noopener noreferrer"&gt;github.com/bastio-ai/bast&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What's Next
&lt;/h2&gt;

&lt;p&gt;This is v0.1.0 — the beginning. Some things I'm working on:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;More LLM provider support beyond Anthropic&lt;/li&gt;
&lt;li&gt;Team dashboards and policy controls&lt;/li&gt;
&lt;li&gt;Expanded PII detection patterns&lt;/li&gt;
&lt;li&gt;IDE integration&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  I'd Love Your Feedback
&lt;/h2&gt;

&lt;p&gt;This is my first Dev.to post, and bast is a brand new project. If you're using AI coding tools in environments with sensitive data, I'd genuinely like to hear how you're handling it:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Are you running AI assistants against production codebases?&lt;/li&gt;
&lt;li&gt;Does your team have any policies around what can be sent to LLMs?&lt;/li&gt;
&lt;li&gt;Would you use something like this, or does it feel like overkill?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Star the repo if it's interesting to you, open an issue if something breaks, and tell me what I'm missing.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;GitHub:&lt;/strong&gt; &lt;a href="https://github.com/bastio-ai/bast" rel="noopener noreferrer"&gt;github.com/bastio-ai/bast&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Website:&lt;/strong&gt; &lt;a href="https://bastio.com" rel="noopener noreferrer"&gt;bastio.com&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>security</category>
      <category>opensource</category>
      <category>cli</category>
    </item>
  </channel>
</rss>
