47 model prices
  1. Home
  2. Releases
  3. Dify
  4. 1.16.0

Dify 1.16.0 release notes

Dify 1.16.0 was released on July 17, 2026. The latest version is 1.20.0.

· 523 listed changes

Release notes

Introducing Dify Agent (Beta): A New Agent Experience in Dify

[!WARNING] You should provide Dify Agent services ⚠️only to trusted, non-malicious users⚠️.

As many of you know, the shell-based LLM agent paradigm has brought a major leap in agent capabilities and changed how we think about agents. Meanwhile, Skills provide a standardized way to package and distribute capabilities, making it easier to build powerful agents.

Today, we are launching Dify Agent. Like other leading agents, it runs in a Linux sandbox. This release includes:

Docs: https://docs.dify.ai/en/self-host/use-dify/build/new-agent/overview

⚠️ Action Required

OpenAI GPT-5.6 Compatibility Notice

The OpenAI plugin previously defaulted to using the Chat Completions API, which was deprecated by OpenAI earlier this year and has increasingly poor support for newer model series. The newly released GPT-5.6 family has many unusual and unique parameter combination restrictions when used with Chat Completions, because OpenAI now provides only minimal compatibility support for Chat Completions with new models. This is not a Dify system issue.

The default API type for new configurations has been changed from Chat Completions to Responses. However, users who previously saved a custom API key with the old default (Chat Completions) will retain that setting, which may cause unexpected errors that appear to originate from Dify.

If you have previously configured a custom OpenAI API key, please check your API type setting and switch to Responses if it is still set to Chat Completions, especially when using GPT-5.6 or later models.

New Features

Agent App (Open Beta)

Smarter AI Workflow Generation

MCP Protocol Upgrade

Web App Customization

Workflow Reliability & Operations

Bug Fixes

Workflow & Agent

Authentication & Access Control

Models & Plugins

Web & UI

Other

Improvements

Performance

Architecture & Code Quality

Security Enhancements

This release includes several security hardening fixes, some of which were addressed after the 1.16.0-rc1 release:


Environment Variable Changes

Added
Variable Default File Description
AGENT_BACKEND_BASE_URL http://localhost:5050 api/.env.example Base URL for the Agent backend service
AGENT_BACKEND_STREAM_READ_TIMEOUT_SECONDS 30 api/.env.example Stream read timeout for Agent backend
AGENT_BACKEND_STREAM_MAX_RECONNECTS 3 api/.env.example Max reconnection attempts for Agent backend streams
AGENT_BACKEND_RUN_TIMEOUT_SECONDS 1200 api/.env.example Overall run timeout for Agent backend
API_WEBSOCKET_WORKER_AMOUNT 1 docker/envs/core-services/shared.env.example Number of WebSocket API workers
DIFY_AGENT_REDIS_URL (empty, derived from REDIS_PASSWORD) docker/envs/core-services/dify-agent.env.example Redis URL for Dify Agent
DIFY_AGENT_REDIS_PREFIX dify-agent docker/envs/core-services/dify-agent.env.example Redis key prefix for Dify Agent
DIFY_AGENT_SHUTDOWN_GRACE_SECONDS 30 docker/envs/core-services/dify-agent.env.example Grace period before forced shutdown
DIFY_AGENT_RUN_RETENTION_SECONDS 259200 docker/envs/core-services/dify-agent.env.example Retention period for agent run records
DIFY_AGENT_PLUGIN_DAEMON_URL (empty, derived from PLUGIN_DAEMON_URL) docker/envs/core-services/dify-agent.env.example Plugin daemon URL for Dify Agent
DIFY_AGENT_PLUGIN_DAEMON_API_KEY (empty, derived from PLUGIN_DAEMON_KEY) docker/envs/core-services/dify-agent.env.example Plugin daemon API key for Dify Agent
DIFY_AGENT_INNER_API_URL (empty, derived from PLUGIN_DIFY_INNER_API_URL) docker/envs/core-services/dify-agent.env.example Inner API URL for Dify Agent
DIFY_AGENT_INNER_API_KEY (empty) docker/envs/core-services/dify-agent.env.example Inner API key (must match INNER_API_KEY_FOR_PLUGIN, not INNER_API_KEY)
DIFY_AGENT_SHELLCTL_ENTRYPOINT http://local_sandbox:5004 docker/envs/core-services/dify-agent.env.example Shellctl entrypoint URL
DIFY_AGENT_SHELLCTL_AUTH_TOKEN (empty) docker/envs/core-services/dify-agent.env.example Auth token for shellctl
DIFY_AGENT_STUB_API_BASE_URL http://agent_backend:5050/agent-stub docker/envs/core-services/dify-agent.env.example Base URL for Agent Stub API
DIFY_AGENT_SERVER_SECRET_KEY (dev default) docker/envs/core-services/dify-agent.env.example JWE encryption key for Agent Stub bearer tokens. Replace in production with python -c 'import secrets; print(secrets.token_urlsafe(32))'
DIFY_AGENT_SHELL_REDACT_PATTERNS (empty) docker/envs/core-services/dify-agent.env.example Patterns for redacting shell output
SHELLCTL_ENABLE_PATH_ISOLATION true docker/envs/core-services/local-sandbox.env.example Enable path isolation in shellctl
NEW_USER_DEFAULT_PLUGIN_IDS (empty) api/.env.example Comma-separated plugin IDs to auto-install for new users
NEW_USER_DEFAULT_MODELS (empty) api/.env.example Default models for new users
WORKFLOW_GENERATION_TIMEOUT_MS 180000 docker/envs/core-services/shared.env.example Timeout for AI workflow generation
WORKFLOW_GENERATOR_NODE_BUILDER_MAX_WORKERS 6 api/.env.example Max parallel workers for node config generation
REDIS_KEEPALIVE true api/.env.example Enable Redis TCP keepalive
REDIS_KEEPALIVE_IDLE 30 api/.env.example Redis keepalive idle time (seconds)
REDIS_KEEPALIVE_INTERVAL 10 api/.env.example Redis keepalive interval (seconds)
REDIS_KEEPALIVE_COUNT 10 api/.env.example Redis keepalive probe count
NEXT_PUBLIC_ENABLE_AGENT_V2 true docker/envs/core-services/web.env.example Enable Agent App v2 (replaces ENABLE_AGENT_V2)
Removed
Variable Old Default File Notes
ENABLE_AGENT_V2 false docker/envs/core-services/web.env.example Replaced by NEXT_PUBLIC_ENABLE_AGENT_V2 (now defaults to true)
Modified
Variable Old New File
NEXT_PUBLIC_ENABLE_FEATURE_PREVIEW false true docker/envs/core-services/web.env.example
Docker Compose Changes

Database Migrations

This release includes 9 new database migrations:

Run flask db upgrade after updating the code.


Upgrade Guide

Model Type Migration

[!IMPORTANT]

One-time legacy model type migration for self-hosted upgrades

If this deployment was upgraded from a Dify version earlier than 1.15.0 and this migration has not already been applied, run it after upgrading.

This migration is not included in flask db upgrade. Without it, legacy model records can cause model-related API requests to fail with errors, preventing affected models from being loaded or used.

Back up the database before applying the migration. The command runs in dry-run mode by default; review the output before rerunning it with --apply. The migration is idempotent and can be safely rerun.

Docker Compose

Run from the docker directory.

# Apply after reviewing the dry-run output
docker compose exec -T api flask data-migrate legacy-model-types --apply \
  > legacy-model-types-apply.jsonl
Source Code Deployment

Run from the repository root after completing flask db upgrade.

# Apply after reviewing the dry-run output
uv run --project api flask data-migrate legacy-model-types --apply \
  > legacy-model-types-apply.jsonl

After applying the migration, run the dry-run command again. If it reports no additional row updates or deletions, restart the relevant services and verify that existing models can be loaded and invoked successfully.

[!IMPORTANT]

  • This release includes 8 new database migrations. Run database migrations as part of the upgrade.
  • 28 new environment variables, 1 removed, and 1 modified. Review the Environment Variable Changes section and update your .env accordingly.
  • Docker Compose configuration changed significantly: two new services (agent_backend, local_sandbox) were added. If you maintain a customized docker-compose.yaml, review the changes and re-apply local customizations carefully.
  • DIFY_AGENT_SERVER_SECRET_KEY ships with a development default. You must replace it in production with a securely generated key: python -c 'import secrets; print(secrets.token_urlsafe(32))'
  • ENABLE_AGENT_V2 has been renamed to NEXT_PUBLIC_ENABLE_AGENT_V2 and now defaults to true. Remove the old variable from your env files.
  • OpenAI GPT-5.6 users: If you have previously configured a custom OpenAI API key, verify your API type is set to Responses (not Chat Completions). See the Known Issues section above.
Docker Compose Deployments
  1. Back up your customized docker-compose YAML and env files.

    cd docker
    cp docker-compose.yaml docker-compose.yaml.$(date +%s).bak
    cp .env .env.$(date +%s).bak 2>/dev/null || true
    
  2. Get the latest code from the release branch or tag.

    git fetch --tags
    git checkout 1.16.0
    
  3. Stop the service. Please execute in the docker directory.

    docker compose down
    
  4. Back up data.

    tar -cvf volumes-$(date +%s).tgz volumes
    
  5. Review the new environment variables (especially DIFY_AGENT_SERVER_SECRET_KEY) and update your .env file. Re-apply any local customizations.

  6. Upgrade services.

    docker compose up -d
    
Source Code Deployments
  1. Stop the API server, Worker, and Web frontend Server.

  2. Get the latest code from the release tag.

    git fetch --tags
    git checkout 1.16.0
    
  3. Update Python dependencies.

    cd api
    uv sync
    
  4. Run the migration script.

    uv run flask db upgrade
    
  5. Configure the new Agent backend service. Refer to the dify-agent section in docker/envs/core-services/dify-agent.env.example for required environment variables.

  6. Restart the API server, Worker, and Web frontend Server.


What's Changed

New Contributors

Full Changelog: https://github.com/langgenius/dify/compare/1.15.0...1.16.0

Source: GitHub release 1.16.0

Newer: 1.16.1Older: 1.15.0Dify