Skip to content

Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.

653 B
Raw Blame
import { describe, expect, it } from 'vitest';
import { redactSensitiveLogValue } from 'src/utils/redact-sensitive';

describe('credential hygiene', () => {
  it('redacts nested credential keys in structured values', () => {
    const value = {
      apiKey: 'uak_test_secret',
      nested: { user_api_key: 'agent_test_secret' },
      safe: 'visible',
    };

    const redactedObject = redactSensitiveLogValue(value);

    expect(JSON.stringify(redactedObject)).not.toContain('uak_test_secret');
    expect(JSON.stringify(redactedObject)).not.toContain('agent_test_secret');
    expect(JSON.stringify(redactedObject)).toContain('visible');
  });
});