One thing to note is that while both words can have negative connotations, "admit" carries much less negativity. Confess is described in the Merriam-Webster Dictionary as "to tell or make known (as something wrong or damaging to oneself)," and even carries religious connotation, where one "[acknowledges] (sin) to God or to a priest." "Admit," on the other hand, is only described to "allow scope for" or "to concede as true or valid," so using the word "admit" may not be too bad.
There are better words though. For example:
- Confirm: "to establish the truth, accuracy, validity, or genuineness of,"
- "I failed, but I can confirm that I've tried my best." (Somewhat technical)
- Attest: "certify; declare to be correct, true, or genuine,"
- "I failed, I can attest to trying my best."
- Assert: "to state with assurance, confidence, or force."
- "I failed, but I assert that I've tried my best."
- Acknowledge: "to admit to be real or true; recognize the existence, truth, or fact of"
- "I failed, but I will acknowledge I've tried my best."
I would go with "confirm," personally, but they're all fine.
Hope this helps!