Add Constraint to Paragraph Field
@Vecta I hope this help you

function MYMODULE_entity_bundle_field_info_alter(&amp;$fields, \Drupal\Core\Entity\EntityTypeInterface $entity_type, $bundle) {
  //with a node
  if ($entity_type-&gt;id() === 'node') {
    if ($bundle == 'article') {
      if (isset($fields['title'])) {
        // change constraint id
        $fields['title']-&gt;addConstraint('UniqueCode', []);
      }
    }
  }
  //with a paragraph
  if ($entity_type-&gt;id() === 'paragraph') {
    // use the paragraph machine name 
    if ($bundle == 'paragraph_name') {
      if (isset($fields['field_name'])) {
        // change constraint id
        $fields['field_name']-&gt;addConstraint('ConstraintId', []);
      }
    }
  }
}