Detail as a noun refers to a specific task that someone is (temporarily) assigned.
To be on detail means to be temporarily assigned to do a task that is different from one's regular assignment. Similar to the verb detailed to, which, according to Collins, means "to appoint or assign for some particular duty". So if I'm on detail tonight, then it means that I've been temporarily assigned to do a task/duty that is different from what I usually do.
This phrase mostly appears to be some sort of military/police/security jargon from all the usages I've seen. Although, looking at user3067860's answer, it seems to be used outside of military/police/security as well. The examples below were only limited to "I'm on detail", so I've included some more examples with the general phrase "is on detail" supporting user3067860's answer and mine as well.
Here are some examples of [I'm / is] on detail being used in different contexts:
From The Guide to Processing Personnel Actions, Volume 2, 1992:
f. Detail. A detail is the temporary assignment of an employee to a different position for a specified period when the employee is expected to return to his/her regular duties at the end of the assignment. (When an employee is on detail, he/she is considered for strength count purposes to be permanently occupying his/her regular position.)
From Elder Sign End Times Trilogy Book One: Arkham by Jennifer Stanfield:
"Actually I have some packing to do and goodbyes to make. Now that you've sealed the alliance, I'm on detail to head back with you to
your bunkers tomorrow to train you all to use our weapons. We'll be bringing your first shipment of medicine and food, too."
"That's great!" he blurted out, glad they'd get to keep hanging out together despite her sudden prickliness today.
From Federal Labor Relations Reporter, Volume 1, 1991:
The Authority found that an employee who is on detail continues to occupy the position from which he was detailed. [...]
From Imprint by A. M. Ellis:
"Kipper," Jace warned.
Kipper cleared his throat. "That's my cue. I've got to get some sleep anyway. I'm on detail tonight." He stood.
"Detail?" Kira asked curiously.
A confident grin spread across Kipper's face. "I lead a team in patrolling parts of the city. We also
do a bit of reconnaissance outside the borders and operate a source
network within. It's pretty complicated."
From Troopship by Kate Holiday:
Know what I'm doing on this bucket? I'm on detail to clean garbage cans!
From Melody of Darkness by Eliza Tilton and Redd Mercury:
The door to Jackson's room opened and Jinx who had assimilated into Derrick's role walked in. "You know, kid, I'm liking this detail less and less. I've been on some boring ops, but this takes the cake. You know what, I think I'll take you up on that."
"What? No way. That easy? Really? I thought you would have told us hell to the no," Marcus said to the bodyguard.
"Look here twinkle toes just because I'm on detail doesn't mean I can't bend rules. My orders are to be pipsqueak's shadow, not to let him out of my sight. They never said where he had to be." Jinx snatched the handball out of mid-flight.
From We Come in Peace by Gerald C. Anderson Sr.:
He arrived at the General's office shortly after leaving Israel's office. He pretended to be cleaning the General's office as was often his detail. When he was sure no one was around he retrieved the recorder from the General's office. Knowing he would be searched when he left, Isaac placed the recorder in the crouch of his pants. He knew the guard would not search him there.
Just after Isaac finished hiding the device General Idit walked through the door.
"What are you doing here," the General commanded?
"Sir, I am Isaac, and I am on detail to clean your office. I was just finishing up.. ."
"Get out...now," the General huffed!
From To Promote the Free Flow of Domestically Produced Fishery Products in Commerce, 1939:
Senator SHEPPARD. How long were you in the rivers and harbors work prior to your present position?
Colonel SOMERVELL. About 23 years.
Senator SHEPPARD. You had your present rank in the Army at the
Colonel SOMERVELL. Yes, sir. General Schley stated that
$25.000,000 ought to be made available the first year, and I agree
with that. I think that that covers the notes that I made this
morning, sir. If there are any questions, I will be glad to try to
Senator SHEPPARD. You are on leave at the present from
your work or position in the Army, in order to do this W. P. A. work?
Colonel SOMERMEL. No, sir; I am on detail to this work.
Senator SHEPPARD. That is what I meant. You are detailed to that work in your
Colonel SOMERVELL. Yes. I am an active officer.
From President's Private Sector Survey on Cost Control: [...], 1982:
Mr. MARGULIES. Janet Colson, who is, I think, in Mr. Meese's office.
The CHAIRMAN. Mr. Meese's office? It is my understanding she was in the Department of Commerce.
Mr. MARGULIES. She is in the Department with us for this function. I think she is on detail from some agency to do that with us.
The CHAIRMAN. She was detailed from some agency to Meese's office, and from Meese's office to Commerce?
Mr. MARGULIES. Yes. Is that correct, Joe? Would you speak to that?
From Code of Federal Regulations: 2000-:
(3) Temporary duties.
An employee ordinarily acquires official responsibility for all matters within the scope of his position immediately upon assuming the position. However, under certain circumstances, an employee who is on detail (or other temporary assignment) to a position or who is serving in an "acting" status might not be deemed to have official responsibility for any matter by virtue of such temporary duties. Specifically, an employee performing such temporary duties will not thereby acquire official responsibility for matters within the scope of the position where he functions only in a limited "caretaker" capacity, as evidenced by such factors as: [...]
From CSRS and FERS Handbook for Personnel and Payroll Offices, Volume 591, 1988:
c. Detail. Payment of an allowance, at the rate prescribed for the post of regular assignment, continues for all periods of detail including transit time. Payment of a differential continues for the first 42 consecutive calendar days, including transit time, during which an employee is on detail from his post of regular assignment. When an employee has been in a pay status during a period of detail at one or more differential posts for more than 42 days, he is thereafter to be paid the differential established for each post of detail in either a nonforeign or a foreign area at which he serves on detail. If the detailed employee is receiving additional pay [...]