Add Audit log within Dify api #15588

Closed
opened 2026-02-21 19:22:26 -05:00 by yindo · 1 comment
Owner

Originally created by @NeatGuyCoding on GitHub (Jul 23, 2025).

Self Checks

  • I have read the Contributing Guide and Language Policy.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report, otherwise it will be closed.
  • Please do not modify this template :) and fill in all the required fields.

1. Is this request related to a challenge you're experiencing? Tell me about your story.

The challenge stems from the fact that Dify, as an AI application development platform, handles sensitive operations including:

  • User authentication and authorization across multiple tenants
  • API token management and usage tracking
  • Model configuration changes that could affect AI behavior
  • Data access patterns including dataset retrievals and file uploads
  • Workflow executions that may involve external tool calls
  • Plugin installations and executions with potential security implications
  • Rate limiting and quota management for billing and security

Currently, Dify has some basic logging infrastructure in place:

  • OperationLog model for basic operation tracking
  • ApiRequest model for API call logging
  • WorkflowAppLog for workflow execution tracking
  • Basic request/response logging via ext_request_logging
  • OpenTelemetry integration for distributed tracing

However, these are insufficient for comprehensive audit requirements that enterprises need for:

  • Compliance frameworks (SOC 2, ISO 27001, GDPR)
  • Security incident investigation
  • User behavior analytics
  • Data access governance
  • Change management tracking

2. Additional context or comments

Dify's existing audit capabilities are fragmented and lack comprehensive coverage:

  1. Limited Scope: Current OperationLog only captures basic operations with minimal context
  2. No Data Access Logging: Missing comprehensive tracking of data access patterns
  3. Incomplete User Activity: No detailed user session tracking or behavior analytics
  4. Plugin Security Gaps: Limited audit trail for plugin installations and executions
  5. No Compliance Features: Missing features like log retention policies, tamper detection, or compliance reporting

3. Can you help us with this feature?

  • I am interested in contributing to this feature.
Originally created by @NeatGuyCoding on GitHub (Jul 23, 2025). ### Self Checks - [x] I have read the [Contributing Guide](https://github.com/langgenius/dify/blob/main/CONTRIBUTING.md) and [Language Policy](https://github.com/langgenius/dify/issues/1542). - [x] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [x] I confirm that I am using English to submit this report, otherwise it will be closed. - [x] Please do not modify this template :) and fill in all the required fields. ### 1. Is this request related to a challenge you're experiencing? Tell me about your story. The challenge stems from the fact that Dify, as an AI application development platform, handles sensitive operations including: - **User authentication and authorization** across multiple tenants - **API token management** and usage tracking - **Model configuration changes** that could affect AI behavior - **Data access patterns** including dataset retrievals and file uploads - **Workflow executions** that may involve external tool calls - **Plugin installations and executions** with potential security implications - **Rate limiting and quota management** for billing and security Currently, Dify has some basic logging infrastructure in place: - `OperationLog` model for basic operation tracking - `ApiRequest` model for API call logging - `WorkflowAppLog` for workflow execution tracking - Basic request/response logging via `ext_request_logging` - OpenTelemetry integration for distributed tracing However, these are insufficient for comprehensive audit requirements that enterprises need for: - **Compliance frameworks** (SOC 2, ISO 27001, GDPR) - **Security incident investigation** - **User behavior analytics** - **Data access governance** - **Change management tracking** ### 2. Additional context or comments Dify's existing audit capabilities are fragmented and lack comprehensive coverage: 1. **Limited Scope**: Current `OperationLog` only captures basic operations with minimal context 2. **No Data Access Logging**: Missing comprehensive tracking of data access patterns 3. **Incomplete User Activity**: No detailed user session tracking or behavior analytics 4. **Plugin Security Gaps**: Limited audit trail for plugin installations and executions 5. **No Compliance Features**: Missing features like log retention policies, tamper detection, or compliance reporting ### 3. Can you help us with this feature? - [x] I am interested in contributing to this feature.
yindo added the 💪 enhancement label 2026-02-21 19:22:26 -05:00
yindo closed this issue 2026-02-21 19:22:26 -05:00
Author
Owner

@crazywoola commented on GitHub (Jul 24, 2025):

This feature will be provided in enterprise version it won't be introduced in community version in the near future.

@crazywoola commented on GitHub (Jul 24, 2025): This feature will be provided in enterprise version it won't be introduced in community version in the near future.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#15588