Stop Worrying About AI Wrecking Your Code: A Template for Unified Development Environments Using Dev Containers and mise

2025.9.11

This blog post is a translation of a Japanese article posted on July 26th, 2025.

The Challenge: Generative AI’s destruction potential

“ChatGPT, fix this bug!”

“Github Copilot, implement this feature!”

If you’ve been experimenting with the latest AI developments tools, you have probably written prompts similar to the above. But is it always safe?

If you blindly trust AI to do its job, you might suddenly find your Node.js version has changed, or unfamiliar tools have been globally installed, or something that worked yesterday stopped working today… You get the idea: AI, left unchecked, can destroy your development environment (or even worse!).

In this article, we provide a development environment template that solves one of the modern developer’s biggest problems: “How can I keep my setup safe, no matter what an AI does?”

🛡️ How This Template Protects You From AI Shenanigans

1. Complete Environment Isolation

This template uses Dev Containers, so your local environment stays intact. Even if AI runs destructive commands, your host OS remains unaffected. And worst case? You can just delete and recreate the container to get back to where you were.

2. Freedom of Development

Need an isolated, safe development environment? Use Dev Containers!

Prefer using your local development tools! That works too!

mise unifies tool management, allowing you to collaborate with everyone in your team, even if your development styles differ.

3. Designed for Instant Recovery

Broke your environment? Just run the Reopen in Container command and you’re back in action!

You can also find all environment settings in .devcontainer/ and .mise.toml, making it easy for new team members to get up and running with an identical setup in minutes.

🎯 How the Template Works

The Core Pieces: Dev Containers and mise

Dev Containers

For people who want to work inside containers!

  • Configured with Docker Compose and a Dockerfile
  • VSCode extensions are automatically installed
  • Works out-of-the-box with GitHub Codespaces.

mise

For people who prefer working locally!

  • All tool versions are managed in .mise.toml
  • Provides the same experience as using a Dev Container would
  • Simplifies per-project tool management.

The configuration files

Here are some configuration files to set up Dev Containers and mise. Feel free to use them in your own project!

# .mise.toml
[tools]
task = "3.41.0"
# node = "20.10.0"  # Add as needed
# python = "3.11.0" # Add as needed 
// .devcontainer/devcontainer.json
{
  "name": "Sample Dev Container with mise",
  "dockerComposeFile": ["./compose.yml"],
  "service": "app",
  "workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}",
  "customizations": {
    "vscode": {
      "extensions": [] // Add necessary extensions here
    }
  },
  "postCreateCommand": "mise trust -- --non-interactive && mise install --yes",
  "postAttachCommand": "",
  "forwardPorts": [3000, 8000, 5173],
  "remoteUser": "root"
} 
# .devcontainer/compose.yml
services:
  app:
    build:
      context: ..
      dockerfile: .devcontainer/Dockerfile

    volumes:
      - ../..:/workspaces:cached
      - mise:/mise

    command: sleep infinity

# Persist mise cache
volumes:
  mise:
# .devcontainer/Dockerfile
FROM mcr.microsoft.com/devcontainers/base:bullseye

# See the Mise + Docker Cookbook
# <https://mise.jdx.dev/mise-cookbook/docker.html>

RUN apt-get update \\
    && apt-get -y --no-install-recommends install \\
    # install any other dependencies you might need
    sudo \\
    curl \\
    git \\
    ca-certificates \\
    build-essential \\
    && rm -rf /var/lib/apt/lists/*

SHELL ["/bin/bash", "-o", "pipefail", "-c"]
ENV MISE_DATA_DIR="/mise"
ENV MISE_CONFIG_DIR="/mise"
ENV MISE_CACHE_DIR="/mise/cache"
ENV MISE_INSTALL_PATH="/usr/local/bin/mise"
ENV PATH="/mise/shims:$PATH"
# ENV MISE_VERSION="..."

# Verify the install script hasn't been tampered with
# <https://mise.jdx.dev/installing-mise.html>
RUN gpg --keyserver hkps://keyserver.ubuntu.com --recv-keys 0x7413A06D \\
    && curl <https://mise.jdx.dev/install.sh.sig> | gpg --decrypt > install.sh \\
    && sh ./install.sh

🔧 Managing Tasks with Task (optional)

As a nice bonus, this template also includes support for managing tasks (e.g. running a development server) using Task.

What’s Good About Task?

  • Task can be used as a simple, powerful alternative to npm scripts and Makefiles
  • Task eliminates the need to remember complex commands
  • Task simplifies environment variables management

Use Task, or Don’t

Using Task is a matter of preference! What’s important is environment consistency, which we’ve already achieved with Dev Containers and mise.

When using Task:

task setup
task dev

If you prefer direct commands:

mise install
# Other development commands...

🚀 How to Use the Template

Step 1: Prepare Your Project

First, create the following directory structure:

your-project/
├── .devcontainer/
│   ├── devcontainer.json
│   ├── compose.yml
│   └── Dockerfile
├── .mise.toml
└── .gitignore

Step 2: Create the Configuration Files

Copy the configuration files we shared earlier into your project. Also, add the following to your .gitignore:

# Your personal Taskfile, if any
Taskfile.yml

# mise related
.mise/

Step 3: Get Started Developing

When using Dev Containers:

  1. Open the project folder in VS Code, or any Dev Container-compatible editor
  2. Select “Reopen in Container” from the command palette
  3. Grab a coffee while your environment sets up
  4. That’s it!

For local development:

  1. Install mise on your local machine
  2. Run mise install in the project root
  3. Grab a coffee while mise installs all the project tools
  4. That’s it!

🎪 Using the Template in Practice

This template can solve various common development problems. Here are a few scenarios you might find it useful:

Preventing AI shenanigans

You: “ChatGPT, implement this feature.”
ChatGPT: “Gladly. Please execute the following commands…”
You: “No problem! I can run this without worry since it’s all inside a container!”

Onboarding New Members

New Member: “Where are the environment setup instructions?”
You: “Just open the project with Dev Containers.”
New Member: “Wait, that’s it?”

Solving Environment Differences

Person A: “It works on my machine!”
Person B: “Not on mine 😡”
You: “Let’s all just use containers!”

💡 Summary: Generative AI and Safety

In the age of generative AI, it is now more important than ever to protect your development environment. In this article, we provided a template that does just that, with highlights including:

  • Safety: Completely isolate your environment with containers
  • Flexibility: Support both Dev Containers and local development
  • Efficiency: Automate complex environment setup
  • Reproducibility: Share the same environment across your entire team
  • Recoverability: Instantly recover from any issues

Now, delegating tasks to AI doesn’t have to be scary!

🔗 Reference Links

📝 Try the Template!

Copy and paste the configuration files from this article into your own project and give it a try!

🎁 Bonus: Taskfile Example

If you’d also like to try using Task, put the following file in the project root:

# Taskfile.dist.yml

version: "3"

vars:
  APP_ENV: development

tasks:
  default:
    desc: Display a list of tasks
    cmds:
      - task -l

  setup:
    desc: Set up mise and install necessary tools
    cmds:
      - mise install

  check:
    desc: Check the mise configuration
    cmds:
      - mise list
      - mise doctor

採用情報

Blog一覧へ戻る

Feel free to contact us

We provide support
for all aspects of SRE,
from design and technical support
to deployment of tools for SRE operations.

Brochure request and inquiries