Skip to content

Release v1.16.1 - Bug Fixes and Security Enhancements

Latest

Choose a tag to compare

@wylswz wylswz released this 28 Jul 03:43
6f8ed69

What's Changed

New Features

Tool Multi-Select Input

  • Workflow tool nodes now support multi-select dropdown inputs, allowing users to choose multiple values from a predefined list when configuring tool parameters. (#39346)

Workflow Node Locator

  • You can now click a node_id in workflow run logs or error messages to locate and highlight the corresponding node in the workflow editor canvas. (#38187)

Workflow Block Selector Improvements

  • The block selector panel now features improved keyboard navigation, category previews, and a more intuitive search experience when adding nodes to workflows. (#39212)

Export Agent DSL from Sidebar

  • Agent apps can now be exported as DSL YAML directly from the app sidebar menu, making it easy to back up or version-control agent configurations. (#39299)

Knowledge Tracing

  • Added more observability traces to knowledge/RAG document processing operations, improving visibility into indexing pipelines. (#38959)

Bug Fixes

Workflow & Collaboration

  • Fixed hidden-tab collaboration leader saving stale drafts when the tab is inactive (#38997)
  • Fixed unsaved edits being dropped when collaboration never connects (#39579)
  • Preserved latest collaboration session after reconnection (#39646)
  • Fixed false draft save error during Strict Mode initialization (#39353)
  • Show persistent error notification when workflow draft save fails (#39293)
  • Wait for workflow worker threads to finish before Celery tasks complete, preventing orphaned executions (#39614)
  • Lazy-load Loro collaboration runtime to reduce initial bundle size (#39631)
  • Don't open node settings panel when clicking a node in comment mode (#39500)
  • Don't close active comment panel when a different comment is resolved (#39491)

RAG & Knowledge

  • Fixed document cleaner stripping valid characters ï (U+00EF), ¿ (U+00BF), ¾ (U+00BE) (#39215)
  • Preserved spaces during recursive text splitting (#39498)
  • Used flush() instead of commit() in dataset service to preserve caller transaction boundaries (#39223)
  • Sent valid body in external knowledge validation probe (#39410)

Agent

  • Fixed agent preview: start new Preview conversations without inheriting an old ID (#39463)
  • Fixed agent chat input being replaced when conversation history updates (#39289)
  • Preserved complete model usage pricing in agent logs (#39201)
  • Show workflow node runs in agent execution logs (#39471)
  • Include workflow runs in agent monitoring stats (#39354)
  • Block unpublished agents from being used in workflows (#39532)
  • Prevent agent preview actions from being clipped (#39510)
  • Prevent build reset from clearing preview chat history (#39490)
  • Fixed agent build draft UI flashing during apply (#39642)

Web App & UI

  • Fixed webapp JWT expiration time being incorrectly set (#39537)
  • Fixed TTS playback in Safari and Firefox (#39444)
  • Fixed clipboard writes failing in embedded apps (#39511)
  • Fixed text generation web app showing infinite loading after timeout (#39268)
  • Fixed chat not passing document if model doesn't support vision (#39461)
  • Stopped chunk length/overlap inputs collapsing to unusable width in narrow containers (#39600)
  • Fixed search hotkey hydration mismatch (#39574)
  • Improved DSL import/export dialog states (#39432, #39409)
  • Fixed basePath doubling in auth refresh redirects (#39273)
  • Show unavailable state for disabled Web Apps (#39392)
  • Fixed permission selector semantics (#39269)
  • Fixed customization page horizontal overflow (#39557)

API & Backend

  • Fixed MCP tool output_schema being treated as required when it's optional (#39453)
  • Honored array-element limit and byte budget for list[File] in VariableTruncator (#39220)
  • Prevented identity logging deadlock (#39449)
  • Rejected host:port-shaped PLUGIN_REMOTE_INSTALL_PORT values with an actionable hint (#39329)
  • Fixed PaginatedResult.pages returning 1 instead of 0 for empty result sets (#39229)
  • Used resource tenant for draft variable files (#39307)
  • Scoped HITL snapshot message lookup to utilize database index (#39351)
  • Returned 400 instead of 500 when file field is missing from audio-to-text endpoints (#39303, #39322)
  • Fixed tool_meta missing tool_provider_type during tool execution (#39513)
  • Applied configured timeout to enterprise inner API requests (#39335)
  • Returned disabled auto-upgrade settings when strategy is missing (#39494)
  • Enforced tool provider type contracts (#39380)
  • Fixed WaterCrawl website crawler handling non-JSON error responses (#37514)
  • Fixed can't create chat app when tenant default model schema errors (#39266)

Security Enhancements

  • The Agent local sandbox now runs behind a dedicated Squid forward proxy with strict ACL rules, preventing the sandbox from reaching internal services directly. Only the /files/ endpoint on the API and /agent-stub/ on agent_backend are permitted, both protected with short-lived access tokens. This significantly reduces the blast radius of arbitrary code execution in the agent sandbox. (#39544)
  • Communication between the Dify API and the agent backend now uses token-based authentication via DIFY_AGENT_API_TOKEN / AGENT_BACKEND_API_TOKEN, hardening the internal service boundary. (#39622)
  • Switched Jinja2 template rendering to use SandboxedEnvironment, preventing template injection attacks in workflow code nodes (#39609)
  • Patched React Server Components DoS vulnerability (#39539)
  • Used re.fullmatch in email validator to reject trailing newlines, preventing bypass attacks (#39320)
  • Validated account status before accepting workspace invitations (#39438)

Performance

  • Lightweight recent apps endpoint — New GET /console/api/apps/recent endpoint reduces the home page "Continue Work" section latency by ~69% (3.2× faster), cutting SQL queries from 19+ to 1 projection SELECT and response size by ~50% (#39625)
  • Lazy-load Home creation modals — Deferred loading of creation modal code until interaction, reducing initial JavaScript bundle (#39634)

Improvements

  • Made agent composer save and publish state consistent (#39637)
  • Simplified Dify logo theming (#39580)
  • Improved workflow block selector UI (#39377)
  • Improved web accessibility semantics (#39505)
  • Nodes are no longer draggable when previewing a workflow (#39131)
  • Display non-LLM settings in integration tool details (#39295)

Environment Variable Changes

New Variables

Variable Default Description
DIFY_AGENT_API_TOKEN dify-agent-run-token-for-dev-only Shared bearer token for API → agent_backend authentication. Change this in production.
AGENT_BACKEND_API_TOKEN dify-agent-run-token-for-dev-only Same token on the agent backend side. Must match DIFY_AGENT_API_TOKEN.
PLUGIN_MODEL_PROVIDERS_CACHE_ENABLED true Set to false if plugins are installed externally and the cache cannot be invalidated.

Important

DIFY_AGENT_API_TOKEN is a new required variable for secure communication between the Dify API and agent backend. The default value (dify-agent-run-token-for-dev-only) is insecure and must be replaced in production. Generate one with:

python -c 'import secrets; print(secrets.token_urlsafe(32))'

Set the same value as AGENT_BACKEND_API_TOKEN on the agent backend side.

Docker Compose Changes

  • Agent sandbox network isolation: local_sandbox is moved off the default network to dedicated agent_sandbox_network + local_sandbox_proxy_network. A new agent_ssrf_proxy service (Squid) is added.
  • Bearer auth: AGENT_BACKEND_API_TOKEN / DIFY_AGENT_API_TOKEN are now passed to api, worker, and agent_backend services.
  • Image tags updated to 1.16.1.

Database Migrations

This release includes 4 new migrations:

  1. 2026_07_15_1600-3c9f8e2a1d7b_add_workflow_run_archive_bundle_cursor_indexes.py — Add indexes to workflow_run_archive_bundles (concurrent on PostgreSQL)
  2. 2026_06_29_1200-b8c9d0e1f2a3_add_step_by_step_tour_state.py — Create account_step_by_step_tour_states table
  3. 2026_07_22_1500-d2825e7b9c10_scope_agent_debug_conversations.py — Add draft_type column to agent_debug_conversations and update unique constraint
  4. 2026_07_23_1200-6f5a9c2d8e1b_add_telemetry_fields_to_dify_setups.py — Add telemetry fields (instance_id, install_reported_at, last_heartbeat_at) to dify_setups

All migrations are additive (new tables, columns, indexes) and are safe to run without downtime.


Upgrade Guide

Docker Compose (Recommended)

cd docker
docker compose down
git pull origin main
docker compose pull
docker compose up -d

The database migrations will run automatically on startup.

Important

Review the new DIFY_AGENT_API_TOKEN variable in .env. The default value is insecure — generate a secure token for production:

python -c 'import secrets; print(secrets.token_urlsafe(32))'

Source Code

git pull origin main
cd api
flask db upgrade

What's Changed

New Contributors

Full Changelog: 1.16.0...1.16.1