Class: PromptSanitizer::Audit::AuditEvent

Inherits:
Struct
  • Object
show all
Defined in:
lib/prompt_sanitizer/audit/base.rb

Overview

Immutable value object representing a single PII-detection event.

The original PII text is never stored — only a 16-char SHA-256 prefix hash, making the log itself safe to persist or export for compliance.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#confidenceObject

Returns the value of attribute confidence

Returns:

  • (Object)

    the current value of confidence



13
14
15
# File 'lib/prompt_sanitizer/audit/base.rb', line 13

def confidence
  @confidence
end

#entity_typeObject

Returns the value of attribute entity_type

Returns:

  • (Object)

    the current value of entity_type



13
14
15
# File 'lib/prompt_sanitizer/audit/base.rb', line 13

def entity_type
  @entity_type
end

#layerObject

Returns the value of attribute layer

Returns:

  • (Object)

    the current value of layer



13
14
15
# File 'lib/prompt_sanitizer/audit/base.rb', line 13

def layer
  @layer
end

#redaction_methodObject

Returns the value of attribute redaction_method

Returns:

  • (Object)

    the current value of redaction_method



13
14
15
# File 'lib/prompt_sanitizer/audit/base.rb', line 13

def redaction_method
  @redaction_method
end

#session_idObject

Returns the value of attribute session_id

Returns:

  • (Object)

    the current value of session_id



13
14
15
# File 'lib/prompt_sanitizer/audit/base.rb', line 13

def session_id
  @session_id
end

#text_hashObject

Returns the value of attribute text_hash

Returns:

  • (Object)

    the current value of text_hash



13
14
15
# File 'lib/prompt_sanitizer/audit/base.rb', line 13

def text_hash
  @text_hash
end

#timestampObject

Returns the value of attribute timestamp

Returns:

  • (Object)

    the current value of timestamp



13
14
15
# File 'lib/prompt_sanitizer/audit/base.rb', line 13

def timestamp
  @timestamp
end

Instance Method Details

#to_hObject



23
24
25
# File 'lib/prompt_sanitizer/audit/base.rb', line 23

def to_h
  super.transform_keys(&:to_s)
end